Sunday, 24 July 2016

DDL Data Definition Language

DDL statements are used to alter/modify a database or table structure and schema. These statements handle the design and storage of database objects.

CREATE – create a new Table, database, schema
ALTER – alter existing table, column description
DROP – delete existing objects from database

Create command to create table

create table Employee
(
EmployeeId int,
Username varchar(100)
)

Alter command to add new column

Alter Table Employee
Add password varchar(100) 

Alter command to change column definition

Alter Table Employee
Alter column password varchar(150) not null

Alter command to drop column

Alter Table Employee
Drop column password

Drop command to drop table

drop table Employee





No comments:

Post a Comment