SQL stands for Structured Query Language. In practice, this is really a misnomer. SQL can do much more than query data – indeed, the language splits neatly into two parts. There is the Data Definition Language (DDL) section and the Data Manipulation Language (DML) section. The former is the part of the language that is used for creating (and/or destroying) database objects such as tables.
Here is an example of DDL code:
CREATE TABLE [dbo].[Customer]
[ID] [int] IDENTITY(1,1) NOT NULL,
[FName] [varchar](20) NULL,
[LName] [varcharint](20) NULL,
[DateOfBirth] [datetime] NOT NULL,
And so on. You can add (within reason) as many columns to the table as you like.
DML statements aren't used to create data structures (or destroy them); they are used to manipulate the data. An example is a SELECT statement:
SELECT ID, FName, LName, DateOfBirth
This was first published in March 2010