修改列名需要在最后加上类型
ALTER TABLE book CHANGE COLUMN publishdate pubDate DATETIME;
修改列的约束和类型
ALTER TABLE book MODIFY COLUMN pubdate TIMESTAMP;
添加新列,要加上类型
ALTER TABLE book ADD COLUMN annual DOUBLE;
删除列
ALTER TABLE author DROP COLUMN annual;
ALTER TABLE author DROP COLUMN IF EXISTS annual;
修改表名
ALTER TABLE author RENAME TO book_author;
表的删除
DROP TABLE book_author;
查看当前库的所以表
SHOW TABLES;