标签:sse oracl ber 信息 table name 插入 alter comment
设有如下关系表S_班名座号(如:s_xg140101):
s_ xg140101 (SNO, SNAME, SSEX, SAGE, SDEPT),主关键字是SNO。
其中SNO为学号,NUMBER(5),学号不能为空,值是惟一的;SNAME为姓名,VARCHAR2(20);SSEX为性别,char(2);SAGE为年龄,NUMBER(2);SDEPT为所在系名,VARCHAR2(10)。写出实现下列功能的SQL语句。
Create Table s_xg140101(
sno number(5) primary key,
sname varchar(20),
ssex char(2),
sage number(2),
sdept varchar(10)
);
insert into s_xg140101 values(95001,'李明勇','男',20,'CS');
insert into s_xg140101 values(95002,'刘晨','女',19,'IS');
insert into s_xg140101 values(95003,'王名','女',18,'MA');
insert into s_xg140101 values(95004,'张立','男',19,'CS');
insert into s_xg140101 values(95005,'张军','男',21,'MA');
insert into s_xg140101 values(95006,'王张凤','女',19,'FL');
insert into s_xg140101 values(95011,'王敬','女',18,'IS');
insert into s_xg140101 values(95021,'张名惠','男',19,'FL');
select * from s_xg140101;
create table s_is as
select * from s_xg140101 where sdept = 'IS'
alter table s_xg140101 add comedate date;
alter table s_xg140101 modify sage number(3) default 19;
alter table s_xg140101 drop column comedate;
rename s_xg140101 to student;
comment on table student is '学生信息表';
truncate table student;
drop table s_is;
drop table s_is cascade constraints;
标签:sse oracl ber 信息 table name 插入 alter comment
原文地址:https://www.cnblogs.com/xcantaloupe/p/9969844.html