What is DML?

We often hear terms like DDL, DML, DQL, and DCL when using relational database management systems (RDBMSs). But what exactly are they?

In this article we’ll look at what DML stands for, and what it does.

What Does DML Stand For?

In the context of SQL, DML stands for Data Manipulation Language.

DML is just one of the various initialisms we can find in SQL. Others include DDL (Data Definition Language), DQL (Data Query Language), DCL (Data Control Language), TCL (Transaction Control Language), and DQL (Data Query Language).

What Does DML Do?

Data Manipulation Language refers to a set of language constructs used to manage and manipulate data stored in a relational database.

DML commands are used to perform basic CRUD (Create, Read, Update, and Delete) operations on data stored in a database. They are essential for managing and manipulating the data stored in a database.

DML statements are used to do things such as, insert data into database tables, read the data, update the data, and delete the data. In this sense, the “create” part of CRUD refers to inserting data.

Common DML Statements

The most common operations performed using DML are:

  • SELECT – used to retrieve data from one or more tables (also considered a DQL statement).
  • INSERT – used to add new rows of data to a table.
  • UPDATE – used to modify existing data in a table.
  • DELETE – used to delete rows from a table.

DML Example

Here’s an example of a DML statement:

INSERT INTO Dogs( DogId, DogName, Color, Meal ) 
VALUES 
( 1, 'Woof', 'Yellow', 'Fish' );

That DML statement inserted a row into a table called Dogs. The table and columns were named on the first line, and the values were specified on the second line after the VALUES clause.

The exact syntax of DML statements can differ between each DBMS, but the basic usage is usually very similar for the common ones.

DML vs DDL

As seen above, DML stands for Data Manipulation Language and it is used to manipulate data.

DDL on the other hand, stands for Data Definition Language, and it is used to create, alter, and delete database objects. The CREATE, UPDATE, and DELETE statements are commonly used DDL statements but there are many more, including proprietary extensions from individual database vendors.