Q

The difference between data definition language (DDL) and data manipulation language (DML)

Learn the difference between data definition language (DDL) and data manipulation language (DML) and get examples of DDL and DML statements.

This Content Component encountered an error
What's the difference between data definition language (DDL) and data manipulation language (DML)?
To answer our reader's question more thoroughly, Mark Whitehorn quotes a section of his book, Inside Relational Databases, in the following expert response.

"SQL stands for Structured Query Language, which is pronounced either as S Q L (as the three letters) or as Sequel. It appears that the former pronunciation is more common in the UK and the latter in the US -- but as the two are interchangeable, it shouldn't be a cause of anxiety.

SQL is a language that splits neatly into two parts. There is the data definition language (DDL) section and the data manipulation language (DML) section."

The DDL section is used for creating database objects, such as tables. In practice, people often use a GUI for creating tables and so on, so it is less common to hand-write DDL statements than it used to be. However an example looks like this:

CREATE TABLE Foo
(MajorPartNum LONG NOT NULL, MinorPartNum LONG NOT NULL,
Quantity LONG NOT NULL,
CONSTRAINT MajorMinor PRIMARY KEY
(MajorPartNum, MinorPartNum) );

The DML section is used to manipulate the data such as querying it. While is also common to use a query builder to create queries, people do still hand-craft DML statements, such as queries. An example might look like this:

SELECT Item, Amount, SaleNo
FROM SALES
WHERE Item = 'Sofa'
ORDER BY SaleNo;

 

  • Do you have questions about data definition language (DDL) and data manipulation language (DML)? Ask our expert!
This was first published in April 2008

Dig deeper on Database management system (DBMS) architecture, design and strategy

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchAWS

SearchContentManagement

SearchOracle

SearchSAP

SearchSOA

SearchSQLServer

Close