问题
单项选择题
第(35)—(36)题基于“学生—选课—课程”数据库中的三个关系: S(S#,SNAME,SEX,AGE),SC(S#,C#,GRADE),C(C#,CNAME,TEACHER)它们的主键用下划线标出。 |
“查询选修了3门以上课程的学生的学生号”,正确的SQL语句是
A.SELECT S# FROM SC GROUP BY S# WHERE COUNT(*)>3
B.SELECT S# FROM SC GROUP BY S# HAVING COUNT(*)>3
C.SELECT S# FROM SC ORDER BY S# HAVlNG COUNT(*)>3
D.SELECT S# FROM SC ORDER BY S# WHERE COUNT(*)>3
答案
参考答案:B