Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Data manipulation language (DML) is the category of SQL statements used to retrieve or change data in existing database objects. Common examples are SELECT, INSERT, UPDATE, DELETE and MERGE. The exact list depends on the database product: for example, Oracle and SQL Server classify SELECT as DML, while PostgreSQL organizes data retrieval separately in its documentation.

What does DML mean in SQL?

DML groups SQL statements by their work on the data stored in existing tables and other database objects. It covers statements that retrieve rows, add rows, change stored values or remove rows. Oracle defines DML as statements that access and manipulate data in existing schema objects; Microsoft describes the category as affecting information stored in a database.

DML is commonly contrasted with data definition language (DDL). DDL creates or changes database structures, such as tables and schemas; DML works with the contents of those structures. The distinction is about the operation being performed, not whether a statement is written in SQL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What are common DML commands?

Statement Typical role
SELECT Retrieves data. Its classification as DML varies by database documentation and teaching convention.
INSERT Adds rows to a table.
UPDATE Changes values in existing rows.
DELETE Removes rows from a table.
MERGE Conditionally updates rows and/or inserts rows, depending on whether they match specified criteria.

Here is an illustrative sequence using an employees table. The table and columns must exist in your database; these statements are examples, not tested output.

SELECT * FROM employees;

INSERT INTO employees (employee_id, last_name)
VALUES (1234, 'Example');

UPDATE employees
SET last_name = 'Updated'
WHERE employee_id = 1234;

DELETE FROM employees
WHERE employee_id = 1234;

Take particular care with UPDATE and DELETE: without an appropriately restrictive WHERE condition, either statement can affect more rows than intended.

Is SELECT a DML statement?

It depends on the database’s terminology. Oracle explicitly classifies SELECT as DML, while noting that it only accesses data. SQL Server’s DML list also includes SELECT. PostgreSQL’s version 16 documentation instead centers its Data Manipulation chapter on inserting, updating and deleting, then discusses extracting data in a following chapter. Some instructional materials call retrieval a separate query-language category; that is a convention, not a universal classification.

For a product-specific answer, check the documentation for the database and version you use. DML inventories differ beyond SELECT, too: Oracle’s list includes statements such as CALL, EXPLAIN PLAN and LOCK TABLE, while Microsoft’s SQL Server list includes BULK INSERT and certain text operations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How does DML relate to transactions?

A transaction can group multiple DML statements into one logical unit of work. For example, a money transfer may need to adjust two balances and record a history entry together, rather than leave only some of those changes applied. Oracle states that its DML statements do not implicitly commit the current transaction. Do not assume that specific transaction behavior applies to every database engine or configuration; consult the relevant product documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.