Data Definition Language (DDL)

Posted by T.saravanan under Sql Server category on | Points: 40 | Views : 1843
Hi All,

Here i am explain DDL concept in Sql Server for beginners.


Its used to create a Database (or) Table
Syntax: Create Database <DatabaseName> // For Create a Database
Create Table <TableName> (<FiledName> <DataType>) //For Create a Table
(Ex: create table test (id int,sName varchar(20))

Its used to Add (or) Delete a Column in the Table
Syntax: Alter Table <TableName> Add <ColumnName> <DataType> //For Add a Column in a Table
Alter Table <TableName> Drop Column <ColumnName> //For Delete a Column in a Table

Its used to Delete a Database (or) Table
Syntax: Drop Database <Database Name> //For delete a database
Drop Table <Table Name> //For delete a Table from Database

Its used to delete a Data's from a Table
Syntax: Truncate Table <Table Name> //For delete a data's from a table

This Syntax are useful to Sql Server beginners.

Cheers :)

Comments or Responses

Posted by: CS1401 on: 8/31/2011 Level:Starter | Status: [Member] | Points: 10
hey really it is great. How you find this. you are genius..;-)

Login to post response