ACCP7.0S2优化myschool数据库设计第四章上机1-4

来源:互联网 发布:知乎的盈利模式 编辑:程序博客网 时间:2024/05/08 02:02
--上机1select MAX(studentresult) as '最高分',MIN(studentresult) as '最低分' from result wheresubjectid=(select subjectid from subject where subjectname='oop')and examdate=(select MAX(examdate) from result where subjectid=(select subjectid from subject where subjectname='oop'))--上机2select subjectname from subject where subjectid in (select subjectid from subject where gradeid=(select gradeid from grade where gradename='S1'))--上机3select 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--上机4if exists(select studentno from student where gradeid=(select gradeid from grade where gradename='S1'))beginupdate student set gradeid=(select gradeid from grade where gradename='S2') where gradeid=(select gradeid from grade where gradename='S1')end

0 0
原创粉丝点击