查询选修了课程的学生人数,SQL语句为SELECT COUNT(DISTINCT S#) FROM SC
举一反三
- 已知表: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
- 以下SQL语句中,____________可以在“学生-课程”数据库正确实现“查询选修了课程的学生总人数”。 A: SELECT COUNT(Sno)FROM SC B: SELECT COUNT(DISTINCT Sno)FROM SC C: SELECT COUNT(*)FROM SC D: SELECT SUM(Sno)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
- 查询选修了课程号为'C2'的学生号和姓名,若用下列SQL的SELECT语句表达时,哪一个是错误的?() A: SELECT S#,SNAME FROM S WHERE S# = (SELECT SS# FROM SC WHERE C# = 'C2' ) B: SELECT S#,SNAME FROM S,SCWHERE S# = SS# AND C# = 'C2' C: SELECT S#,SNAME FROM S,SC WHERE S# = SS# AND C# = 'C2' ORDER BY S# D: SELECT S#,SNAME FROM S WHERE S# IN (SELECT SS# FROM SC WHERE C# ='C2' )
- 若需统计“选课”表中已经选修了课程的学生人数,下面语句正确的是( )。 A: SELECT COUNT(DISTINCT学生号)FROM选课 B: SELECT COUNT(学生号)FROM选课 C: SELECT COUNT(*)FROM选课 D: SELECT COUNT(DISTINCT*)FROM选课