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

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

What's the difference between data definition language (DDL) and data manipulation language (DML)?

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on the hottest data and information management trends today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchDataManagement.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDataManagement.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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