Q
Problem solve Get help with specific problems with your technologies, process and projects.

What is the difference between data definition language (DDL) and SQL?

Learn the difference between a data definition language (DDL), also known as data descriptive language, and the Structured Query Language (SQL). Find examples of both DDL and SQL.

What’s the difference between a data definition language (DDL) and a query language?

I assume that you mean SQL in this question. SQL stands for “Structured Query Language,” which implies (erroneously) that the language can be used only for querying. Of course, it CAN be used for querying – but it can also be used to create database components. 

So SQL is split into sections, one of which is the query language. As the name implies, this part of SQL is for writing queries – for example:

SELECT EmployeeNo, FirstName, LastName, DateOfBirth, DateEmployed
FROM EMPLOYEES
WHERE EmployeeNo = 2;

The data definition language (also known as the data descriptive language) is composed of statements that can be used to create, or modify, components of a database, such as its tables. For example:

CREATE TABLE [dbo].[tblDataSheet](
      [SheetID] [int] IDENTITY(1,1) NOT NULL,
      [TDStamp] [datetime] NULL,
      [Family] [varchar](50) NULL,
      [Genus] [varchar](50) NULL,
      [Species] [varchar](50) NULL,
      … lots more columns described here….
      [BarCode] [varchar](50) NULL,
 CONSTRAINT [pkSheet] PRIMARY KEY CLUSTERED
(
      [SheetID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

This was last published in August 2010

Dig Deeper on Enterprise data architecture best practices

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchAWS

SearchContentManagement

SearchOracle

SearchSAP

SearchSQLServer

Close