题目内容:
基于“学生.选课.课程”数据库中的如下三个关系:学生基本信息:S(S#,SNAME,SEX,AGE)
选课信息:SC(S#,C#,GRADE)
课程信息:C(C#,CNAME,TEACHER)
若要求“查询选修了5门以上课程的学生的学生号”,正确的SQL语句是( )。 A.SELECT S# FROM SC ORDER BY S# WHERE COUNT(﹡)>5
B.SELECT S# FROM SC ORDER BY S# HAVING COUNT(﹡)>5
C.SELECT S# FROM SC GROUP BY S# WHERE COUNT(﹡)>5
D.SELECT S# FROM SC GROUP BY S# HAVING COUNT(﹡)>5
参考答案:
答案解析: