Alter command in SQL is used to add, delete, or modify columns in an existing table. Alter in SQL is will help to make changes in the existing columns like add columns or delete columns.
To add a column in an existing table.
ALTER TABLE table_name ADD column_name datatype;
To delete a column from a table.
ALTER TABLE table_name DROP COLUMN column_name;
In this example we will look at how to add a column “Year” in a Student_details table.
ALTER TABLE Student_details ADD Year int;Previous Next
Download Interview Questions asked by top MNCs in 2019?