在学生选课表SC中,查询选修了3号课程的学生的学号(XH)及其成绩(GD)。查询结果按分数的降序排列。实现该功能的正确SQL语句是( )。
A: SELECT XH,GD FROM SC WHERE CH='3'ORDER BY GD DESC
B: SELECT XH,GD FROM SC WHERE CH='3'ORDER BY GD ASC
C: SELECT XH,GD FROM SC WHERE CH='3'GROUP BY GD DESC
D: SELECT XH,GD FROM SC WHERE CH='3' GROUP BY GD ASC
A: SELECT XH,GD FROM SC WHERE CH='3'ORDER BY GD DESC
B: SELECT XH,GD FROM SC WHERE CH='3'ORDER BY GD ASC
C: SELECT XH,GD FROM SC WHERE CH='3'GROUP BY GD DESC
D: SELECT XH,GD FROM SC WHERE CH='3' GROUP BY GD ASC
举一反三
- 在学生选课表SC中,查询选修了3号课程的学生的学号(XH)及其成绩(CJ)。查询结果按分数的降序排列。实现该功能的正确SQL语句是( )。 A: SELECT XH, CJFROM SC WHERE CH=′3′ORDER BY CJDESC B: SELECT XH, CJ FROM SC WHERE CH=′3′ORDER BY CJ ASC C: SELECT XH, CJ FROM SC WHERE CH=′3′GROUP BY CJ DESC D: SELECT XH, CJFROM SC WHERE CH=′3′GROUP BY CJ ASC
- 若要求“查询选修了3门以上课程的学生的学号”,正确的SQL语句是( ) A: SELECT sNo FROM SC GROUP BY sNo WHERE COUNT(*)> 3 B: SELECT sNo FROM SC GROUP BY sNo HAVING COUNT(*)> 3 C: SELECT sNo FROM SC ORDER BY sNo WHERE COUNT(*)> 3 D: SELECT sNo FROM SC ORDER BY sNo HAVING COUNT(*)> 3
- 设有学生选课表:SC(学号,课程号,成绩),要求在该表中查询缺少学习成绩的学生学号和课程号,实现此查询要求的SELECT语句是______。 A: SELECT 学号,课程号 FROM SC WHERE 成绩 IS NULL B: SELECT 学号,课程号 FROM SC WHERE 成绩 IS NOT NULL C: SELECT 学号,课程号 FROM SC WHERE 成绩=NOT NULL D: SELECT 学号,课程号 FROM SC WHERE 成绩=NULL
- 查询有选课记录,但没有考试成绩的学生的学号和课程号,正确的SQL语句是(4)。 A: SELECT 学号,课程号 FROM SC WHERE 成绩=‘’ B: SELECT 学号,课程号 FROM SC WHERE 成绩=NULL C: SELECT 学号,课程号 FROM SC WHERE 成绩 IS NULL D: SELECT 学号,课程号 FROM SC WHERE 成绩=0
- 查询学生选修课程成绩小于60分的学号,正确的SQL语句是 A: SELECT DISTINCT 学号 FROM SC WHERE "成绩"<60 B: SELECT DISTINCT 学号 FRCIM SC WHERE 成绩 <"60" C: SELECT DISTINCT 学号 FROM SC WHERE 成绩 <60 D: SELECT DISTINCT "学号" FROM SC WHERE "成绩"<60