What is DDL Command in SQL-Server?

Data Definition Language (DDL)

    • DDL stands for Data Definition Language. 
    • DDL statements are used to define the database structure or schema. 
    • It is used to create and modify the structure of database objects in database.
    •  Examples

      CREATE, ALTER, DROP statements

      1. CREATE
        – For creating databases & database objects.

      Syntax for creating database:

      CREATE DATABASE DataBaseName

Create DataBase Students

               Syntax for creating Table:

  CREATE TABLE StudentsMst
StudentId int,|
StudentName varchar(50),
StudentCity varchar(50),

   – For altering/modifying the exsisting tables.

     Syntax for Altering/Adding columns:

  Alter Table TableName Add Column1 datatype,Column2 datatype,…..


Alter Table StudentsMst Add DateOfBirth datetime,SchoolName varchar(300)

   Syntax for changing column datatype:

   Alter Table TableName Alter Column ColumnName NewDataType


Alter Table StudentsMst Alter Column StudentPincode BigInt

For delete objects from the database

Drop Table table1,table2,…

Drop DataBase Students

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *