• 2022-10-26
    在学生选课数据库中,检索被全部学生所选修的课程的SQL可以描述为( )
    A: SELECT Cno FROM SC WHERE (Select Count(Sno) FROM SC GROUP BY Cno) = (SELECT Count(*) FROM Student) ;
    B: SELECT Cno FROM SC x WHERE NOT EXISTS (SELECT * FROM Student s WHERE NOT EXISTS (SELECT * FROM SC y WHERE x.Cno = y.Cno AND s.Sno= y.Sno);
    C: SELECT Cno FROM SC x WHERE NOT EXISTS (( SELECT Sno FROM Student) EXCEPT ( SELECT y.Sno FROM SC y, Student z WHERE x.Cno=y.Cno AND z.Sno=y.Sno));
    D: 以上答案都不对
  • B,C

    举一反三

    内容

    • 0

      ‏检索选修课程“C2”的学生中成绩最高的学生的学号。正确的SELECT语句是()。‍ A: SELECT SNO FROM SC WHERE CNO='C2' AND GRADE >= ( SELECT GRADE FORM SC WHERE CNO='C2' ); B: SELECT SNO FROM SC WHERE CNO='C2' AND GRADE IN ( SELECT GRADE FORM SC WHERE CNO='C2' ); C: SELECT SNO FROM SC WHERE CNO='C2' AND GRADE NOT IN ( SELECT GRADE FORM SC WHERE CNO='C2' ); D: SELECT SNO FROM SC WHERE CNO='C2' AND GRADE >= ALL ( SELECT GRADE FORM SC WHERE CNO='C2' );

    • 1

      “查询没有学习成绩的学生的学号和课程号”的SQL语 句是( ) (2.0) A: SELECT sno,cno FROM SC WHERE grade = NULL B: SELECT sno,cno FROM SC WHERE grade IS ' ' C: SELECT sno,cno FROM SC WHERE grade IS NULL D: SELECT sno,cno FROM SC WHERE grade = ' '

    • 2

      已知学生选课信息表sc(sno, cno, degree)。查询“至少选修了一门课程,但没有成绩的学生学号和课程号”的SQL语句是( )。 A: SELECT sno, cno FROM sc WHERE degree=NULL; B: SELECT sno, cno FROM sc WHERE degree IS ''; C: SELECT sno, cno FROM sc WHERE degree IS NULL; D: SELECT sno, cno FROM sc WHERE degree='';

    • 3

      已知学生选课信息表:sc(sno,cno,grade)。查询“至少选修了一门课程,但没有学习成绩的学生学号和课程号”的SQL语句是( )。 A: SELECT sno,cno FROM sc WHERE grade=NULL B: SELECT sno,cno FROM sc WHERE grade IS C: SELECT sno,cno FROM sc WHERE grade IS NULL D: SELECT sno,cno FROM sc WHERE grade=

    • 4

      查询所有有成绩的学生学号和课程号。正确的SELECT语句是()。 A: Select sno , cno from sc where grade < > null B: Select sno as 学号, cno as 课程号 from sc where grade is not null C: Select sno , cno from sc where grade !=‘ ’ D: Select sno , cno from sc where grade is not null