Explain the use of Alter Table command. Explain with an example.
ALTER table command is used to modify a table’s column attributes, renaming a table or column etc.
Example:Add column to an existing tableALTER table student ADD COLUMN department varchar(100);
Rename a tableALTER table student RENAME TO studentdata;
What are the limitations of Alter Table command?
- Column can’t be deleted with alter command.
- Column can’t be renamed a column.
- Column can’t be added in between of the existing columns.
- When a column is added, it will be added at the end of the table.