ALTER STATEMENT

ü  ‘ALTER ‘ statement is used to change the structure of a table.
ü  It is used to add, modify or delete columns in a table.


ü  To add a column in a table

ü  For add a column in a table we can use following command

Syntax:
ALTER TABLE table1 ADD col_name datatype
Example:

ü  To delete  a column in a table

ü  To delete a column in a table we can use following command

Syntax:
ALTER TABLE table1 DROP COLUMN  col_name
Example:


ü  To  change the  data type of a column in a table

ü  To change datatype of a column in a table we can use following command.

Syntax:
ALTER TABLE table1 ALTER COLUMN  col_name  datatype
ALTER STATEMENT ALTER STATEMENT Reviewed by kamal kumar das on January 20, 2012 Rating: 5

No comments:

ads 728x90 B
Powered by Blogger.