当前位置:Gxlcms > 数据库问题 > Oracle中表字段相关操作举例

Oracle中表字段相关操作举例

时间:2021-07-01 10:21:17 帮助过:5人阅读

创建测试表 create or replace table student ( xh number(4), --学号 xm varchar2(10), --姓名 sex char(2), --性别 birthday date, --日期 sal number(7,2) --奖学金 ); --添加一个字段 alter table student add (studentid number(10)); --添加多个字段 alter table student add ( xh number(4), --学号 xm varchar2(10), --姓名 sex char(2), --性别 birthday date, --日期 sal number(7,2) --奖学金 ); --删除一个字段 alter table student drop column xh; --修改一个字段 --1.修改长度 alter table student modify (sex char(5)); --2.修改字段的类型 alter table student modify (sex varchar2(5)); --给表改名字 rename student to stuinfo; --字段如何改名字 --1.先删除 alter table student drop column sal; --2.再添加 alter table student add(salary varchar2(6));

 

Oracle中表字段相关操作举例

标签:ora   student   name   date   字段   number   如何   类型   ble   

人气教程排行