ChatGPT:
Data Manipulation Language (DML) is a subset of SQL (Structured Query Language) used to manage and manipulate data within a database. With DML, users can insert, query, update, and delete data — essentially everything you'd typically do with data stored in a database.
The main DML commands are:
Command |
Purpose |
SELECT |
Retrieve data from a table |
INSERT |
Add new data |
UPDATE |
Modify existing data |
DELETE |
Remove data |
-- Insert
INSERT INTO customers (name, city) VALUES ('Müller', 'Berlin');
-- Query
SELECT * FROM customers WHERE city = 'Berlin';
-- Update
UPDATE customers SET city = 'Hamburg' WHERE name = 'Müller';
-- Delete
DELETE FROM customers WHERE name = 'Müller';
Key Points:
-
DML deals with the data inside tables, not with the structure of the tables themselves (that's handled by Data Definition Language, DDL).
-
DML operations can often be rolled back (undone), especially when transactions are supported.
In short: DML is the toolset you use to keep your database dynamic and interactive by constantly adding, reading, modifying, or deleting data.