ALTER TABLE — 更改表属性
语法
ALTER TABLE table [ * ]
ADD [ COLUMN ] column type
ALTER TABLE table [ * ]
ALTER [ COLUMN ] column { SET DEFAULT value | DROP DEFAULT }
ALTER TABLE table [ * ]
RENAME [ COLUMN ] column TO newcolumn
ALTER TABLE table
RENAME TO newtable
ALTER TABLE table
ADD table constraint definition
用法
向表中增加一个 VARCHAR 列:
ALTER TABLE distributors ADD COLUMN address VARCHAR(30);
对现存列改名:
ALTER TABLE distributors RENAME COLUMN address TO city
使 用说明
ALTER TABLE user_info ADD username varchar(50) COLLATE Chinese_PRC_CI_AS NULL
来自: http://hi.baidu.com/wgd216/blog/item/b283a145d340863d8694732e.html