• 2022-06-07
    基于“学生-选课-课程”数据库中的三个关系: 学生表S(SNO,SNAME,SEX,BIRTHYEAR,DEPT),主码为SNO 课程表C(CNO,CNAME,TEACHER),主码为CNO 选课表SC(SNO,CNO,GRADE),主码为(SNO,CNO) [br][/br]查找“选修了至少5门课程的学生的学号”,正确的SQL语句是( )。
    A: SELECT SNO FROM SC GROUP BY SNO HAVING COUNT(*) >=5;
    B: SELECT SNO FROM SC GROUP BY SNO WHERE COUNT(*) >=5;
    C: SELECT SNO FROM SC HAVING COUNT(*) >=5;
    D: SELECT SNO FROM SC WHERE COUNT(*) >=5;
  • 举一反三