What is DML in SQL?
DML (Data Manipulation Language) is the part of SQL used for working with the data inside tables: adding, changing, deleting, and retrieving it.
The main DML commands
SELECT, retrieves data from tables.
sql
SELECT Name, Age FROM Employees WHERE DepartmentID = 101;INSERT, adds new records to a table.
sql
INSERT INTO Employees (Name, Age, DepartmentID) VALUES ('Anna', 28, 102);UPDATE, changes existing records.
sql
UPDATE Employees SET Age = 29 WHERE Name = 'Anna';DELETE, removes records from a table.
sql
DELETE FROM Employees WHERE Name = 'Anna';DML's purpose: to work with the contents of tables, not their structure.
Put simply, DML is SQL's toolkit for manipulating data, adding, updating, deleting, and retrieving information from the database.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.