• ALTER TABLE command is used to modify table structure.
  • We can add new column, remove existing column or change data type and size by using alter table command.
  • If records are available in a specific column then we cannot decrease its size but can increase.

To Add new Column:

  • Syntax:
ALTER TABLE <table name> ADD <new_column_name><data type> (size)…) ;
  • Example:
ALTER TABLE student ADD ( city varchar2(15) );

To Modify Existing Column:

  • Syntax:
ALTER TABLE <table name> MODIFY <column_name><new data type> (size)…) ;
  • Example:
ALTER TABLE student MODIFY (city varchar2(20)) ;

To Drop Exiting Column:

  • Syntax:
ALTER TABLE <table name> DROP COLUMN <column_name>;
  • Example:
ALTER TABLE student DROP COLUMN city;
  • Alter table command cannot be used for renaming columns and table.