1.6. 修改表
重命名
基本语法:
alter table old_table_name rename to new_table_name;
把表score4修改成score5
alter table score4 rename to score5;
增加/修改列信息
- 查询表结构
desc score5;
- 添加列
alter table score5 add columns (mycol string, mysco string);
- 查询表结构
desc score5;
- 更新列
alter table score5 change column mysco mysconew int;