1、添加單列
ALTER TABLE table_name ADD [COLUMN] column_name column_definition [FIRST | AFTER column_name]
2、添加多列
ALTER TABLE table_name ADD [COLUMN] (column_name column_definition,...)
3、删除列
ALTER TABLE table_name DROP [COLUMN] column_name
4、添加主鍵限制
ALTER TABLE table_name ADD [CONSTRINT [symbol]] PRIMARY KEY [index_type] (index_column_name,...)
5、删除主鍵限制
ALTER TABLE table_name DROP PRIMARY KEY
6、添加唯一限制
ALTER TABLE table_name ADD [CONSTRINT [symbol]] UNIQUE [INDEX|KEY] [index_name][index_type] (index_column_name,...)
7、删除唯一限制
ALTER TABLE table_name DROP {INDEX|KEY} index_name
8、添加外鍵限制
ALTER TABLE table_name ADD [CONSTRINT [symbol]] FOREIGN KEY [index_name](index_column_name,...) reference_definition
9、删除外鍵限制
ALTER TABLE table_name DROP FOREIGN KEY fk_symbol
10、添加/删除預設限制
ALTER TABLE table_name ALTER [COLUMN] column_name {SET DEFAULT literal | DROP DEFAULT}
11、修改列定義
ALTER TABLE table_name MODIFY [COLUMN] column_name column_definition [FIRST | AFTER column_name]
12、修改列名稱
ALTER TABLE table_name CHANGE [COLUMN] old_column_name new_column_name column_definition [FIRST | AFTER column_name]
13、資料表更名
方式一:
ALTER TABLE table_name RENAME [TO | AS] new_column_name
方式二:
RENAME TABLE table_name TO new_column_name [,table_name2 TO new_column_name2]...