);
insert into test(COL1,COL2,COL3 ) values(null,'B2','');
insert into test(COL1,COL2,COL3 ) values(1,'B2','C2'); --37 --(1)
select Sname,Sdept,Cno,Grade into s1 from student,SC where --(2) create char(10),
st_sdept
26
student.Sno=SC.Sno and
Sname='计算机系' and Grade>80
table new_sc1(st_name
char(20),
sc_cno char(10),
sc_grade int);
insert into
new_sc1(st_name,st_sdept,sc_cno,sc_grade)
select Sname,Sdept,Cno,Grade from SC,student where --38
delete from SC where Grade<50 --39 --(1)
delete from SC where Grade<50 and
27
SC.Sno=student.Sno and
Sdept='计算机系' and Grade>80
Cno in(select Cno from Course
where Cname='信息系 ') --(2)
delete from SC from Course where SC.Cno=Course.Cno and Grade<80 and Cname='信息系 ' --40 update SC
set Grade=Grade+10 where Cno='c01' --41 --(1) update SC
set Grade=Grade+10
where Cno in(select Cno from Course where Cname='计算机应用') and Sno in(select Sno
28
from student where Sdept='计算机系') --(2) update SC
set Grade=Grade+10 from
Course,student
where and
Course.Cno=SC.Cno
SC.Sno=student.Sno and Cname='计算机应用'and Sdept='计算机系' --42
create view stv1 as
select student.Sno,Sname,Sage from student,SC,Course where
Course.Cno=SC.Cno
and
SC.Sno=student.Sno and Sdept='计算机系' and Cname='数据库基础 ' --43
29
create view stv2 as
select * from student where Sdept='计算机系' --44
select Sname from student,SC,Course where
Course.Cno=SC.Cno
and
SC.Sno=student.Sno and Sdept='信息系' and Cname='数据库基础 ' and Grade>80 --45
drop view stv1 --46 update stv2 set Sage=Sage+1 where Sdept='计算机系' --47
select Sname from student
30