select count(distinct
举一反三
- 按课程号分类,统计相应的选课人数() A: select cid, count(distinct sid) from sc group by cid B: select cid, count(*) from student group by cid C: select cid, count(distinct cid) from sc group by cid D: select cid, count(distinct sid) from student group by cid
- 若需统计“选课”表中已经选修了课程的学生人数,下面语句正确的是( )。 A: SELECT COUNT(DISTINCT学生号)FROM选课 B: SELECT COUNT(学生号)FROM选课 C: SELECT COUNT(*)FROM选课 D: SELECT COUNT(DISTINCT*)FROM选课
- 已知表:SC(S#,C#,CRADE),其中S#、C#、CRADE分别代表学号、选修课号、成绩。则统计选修了课程的学生的总数的SQL语句应为: A: SELECT COUNT(DISTINCT S B: ) FROM SC C: SELECT COUNT(DISTINCT *) FROM SC D: SELECT COUNT(S E: ) FROM SC F: SELECT COUNT(DISTINCT C G: ) FROM SC
- 以下哪条语句可以实现查询选了课的学生人数( )。 A: select count(*) from sc B: select count(sno) from sc C: select count(distinct sno) from sc D: select count(cno) from sc
- 设选课表的结构为:(学号、课程号、成绩),其中学号+课程号为主键。要从选课表中统计每个学生选修的课程门数,应使用的SELECT语句是______。 A: SELECT COUNT(*) FROM 选课表 B: SELECT COUNT(*) FROM 选课表 GROUP BY学号 C: SELECT DISTINCT COUNT(*) FROM 选课表 D: SELECT DISTINCT COUNT(*) FROM 选课表 GROUP BY学号