数据库实验难题

  • 查询同时选修了数据库及其先修课的学生学号和姓名
    select student.Sno,student.sname from Student, SC sc1,SC sc2,Course c1,Course c2
    where sc1.Cno=c1.Cno
    and sc2.cno=c2.Cno
    and sc1.Sno=sc2.Sno
    and sc1.Sno=student.sno
    and c1.Cname='数据库'
    and c2.Cno=c1.cpno

  • 查询缺少成绩的所有学生的详细情况;
    select * from SC,Course,Student
    where student.Sno=sc.Sno
    and course.Cno=sc.Cno
    and sc.Grade **is NULL **

注意为空用的是is NULL而不是 =NULL

  • 姓名不确定时用的是Like [姓名]而不是 = [姓名]
posted @ 2020-10-19 10:57  zzzmmm37  阅读(165)  评论(0)    收藏  举报