Sunday, 9 October 2011

DDL-Alter

nThe ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
Syntax:
üALTER TABLE table_name ADD column_name datatype
üALTER TABLE table_name DROP COLUMN column_name
üALTER TABLE table_name ALTER COLUMN column_name datatype
Query:
üALTER TABLE EMPtbl1 ADD DateOfBirth date
üALTER TABLE EMPtbl1 ALTER COLUMN DateOfBirth year
üALTER TABLE Persons DROP COLUMN DateOfBirth

No comments:

Post a Comment