The ALTER TABLE Statement
ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
To add a column in a table
Syntax :
alter tablename add column columnname datatype
Example:
alter empdetails add column city varchar (50)
To delete a column in a table
Syntax :
alter table tablename drop column columnname
Example:
alter table empdetails drop column city
To change the data type of a column in a table
Syntax :
alter table tablename alter column columnname datatype
Example:
No comments:
Post a Comment