1-4 章练习

来源:互联网 发布:l型的橱柜的算法 编辑:程序博客网 时间:2024/06/05 10:22
上机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  

0 0
原创粉丝点击