oracle中的修改表结构

1.更改表名

rename 原表名 to 新表名
rename stu to student;

2.更改列名

alter table 表名 rename column 原列名 to 新列名;
alter table stu rename column sex to gender;

3.删除一列

alter table 表名 drop column 列名;
alter table stu drop column gender;

4.增加一列

alter table 表名 add  列名 列的类型;
alter table employee add  sex char(2);

 5.修改列的类型

alter table 表名 modify 列名 列的类型;
alter
table stu modify sex varchar2(4);

 

posted on 2019-04-03 15:27  小毛豆1997  阅读(251)  评论(0编辑  收藏  举报