Ask the Expert

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

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: