5.SQL语句之二维表维护之字段的添加、删除、修改以及表名的修改

二维表的维护

添加新的字段  alter table 表名 add 字段名 字段类型 

alter table student add sphone number(11)

删除原有字段   alter table 表名 drop column 字段名  

alter table student drop column sphone

修改原有字段

 修改字段名  alter table 表名 rename column 字段名 to 新字段名 

alter table student rename column sphone to phone;

 修改字段类型  alter table 表名 modify 字段名 新的类型

alter table student modify sphone varchar2();

修改表名     rename 原表名 to 新表名

rename student to student2;

删除表    drop table 表名

drop table student;

猜你喜欢

转载自blog.csdn.net/weixin_39722922/article/details/85172886