十一、修改表格(alter table)
时间:2020-04-24 16:46:05
收藏:0
阅读:62
1.1 添加列
alter table (表名) add (列名 数据类型);
alter table student add (score number(3)); |
1.2 修改列类型
alter table (表名) modify (列名 数据类型);
alter table student modify (score number(5,2)); |
1.3 修改列名
alter table (表名) rename column (当前列名) to (新列名);
alter table student rename column score to fenshu; |
1.4 删除列
alter table (表名) drop column (列名);
alter table student drop column fenshu; |
1.5 重命名表格
rename student to stu; |
2. 删除表格
drop table stu; |
原文:https://www.cnblogs.com/qiaoxin11/p/12768270.html
评论(0)