ALTER [IGNORE] TABLE table_name specification [,specification]
Specifications can be:
ADD [COLUMN] column name (column definitions) [FIRST or AFTER column_name] ADD INDEX [index_name] (column_list) ADD PRIMARY KEY (column_list) ADD UNIQUE [index_name] (column_list) ALTER [COLUMN] column_name {SET DEFAULT default_value or DROP DEFAULT} CHANGE [COLUMN] old_col_name create_definition DROP [COLUMN] col_name DROP PRIMARY KEY DROP INDEX index_name MODIFY [COLUMN] create_definition RENAME [AS] new_tbl_name
The IGNORE keyword causes rows with duplicate values in unique keys to be deleted; otherwise, nothing happens.
ALTER TABLE employee ADD COLUMN Account_Number INT ALTER TABLE employee ADD INDEX (ID) ALTER TABLE employee ADD PRIMARY KEY (ID) ALTER TABLE employee ADD UNIQUE (ID) ALTER TABLE employee CHANGE ID salary INT ALTER TABLE employee DROP Customer_ID ALTER TABLE employee DROP PRIMARY KEY
ALTER TABLE employee DROP INDEX Customer_ID ALTER TABLE employee MODIFY First_Name varchar(100) ALTER TABLE employee RENAME Customer
Related Scripts with Example Source Code in same category :