上机1
select MAX(studentresult) as '最高分',MIN(studentresult) as '最低分' from result where
subjectid=(select subjectid from subject where subjectname='oop')
and examdate=(select MAX(examdate) from result
where subjectid=(select subjectid from subject where subjectname='oop'))
--上机2
select subjectname from subject where subjectid in
(select subjectid from subject where gradeid=(select gradeid from grade where gradename='S1'))
--上机3
select studentname from student where studentno not in(
select studentno from result where subjectid=(select subjectid from subject where subjectname='SQL')
and examdate=(select MAX(examdate) from result where subjectid=(
select subjectid from subject where subjectname='java'))) and gradeid=1
--上机4
if exists(select studentno from student where gradeid=(select gradeid from grade where gradename='S1'))
begin
update student set gradeid=(select gradeid from grade where gradename='S2') where gradeid=(select gradeid from grade where gradename='S1')
end
1-4 章练习
最新推荐文章于 2020-12-08 21:35:13 发布