题目内容

SQL 中,与“NOT IN”等价的操作符是。

A. =ANY
B. <>ANY
C. =ALL
D. <>ALL

查看答案
更多问题

第 8-11 题基于以下三个表,即学生表 S、课程表 C 和学生选课表 SC,它们的结构如下:S(S#,SN,SEX,AGE,DEPT)C(C#,CN)SC(S#,C#,GRADE)其中,S#为学号,SN 为姓名,SEX 为性别,AGE 为年龄,DEPT 为系别,C#为课程号,CN 为课程名,GRADE 为成绩。检索所有比“王华”年龄大的学生姓名、年龄和性别。正确的 SELECT 语句是。

A. SELECT SN,AGE,SEXFROM SWHERE AGE>(SELECT AGE FROM S WHERE SN=“王华”)
B. SELECT SN,AGE,SEXFROM SWHERE SN=“王华”
C. SELECT SN,AGE,SEXFROM SWHERE AGE>(SELECT AGE WHERE SN=“王华”)
D. SELECT SN,AGE,SEXFROM SWHERE AGE > 王华.AGE

检索选修课程“C2”的学生中成绩最高的学生的学号。正确的 SELECT 语句是。

A. SELECT S
B. FROM SCWHERE C
C. =“C2” AND GRADE >=(SELECT GRADEFROM SCWHERE C
D. =“C2”)
E. SELECT S
FROM SCWHERE C
G. =“C2” AND GRADE IN(SELECT GRADEFROM SCWHERE C
H. =“C2”)
I. SELECT S
J. FROM SCWHERE C
K. =“C2” AND GRADE NOT IN(SELECT GRADEFROM SCWHERE C
L. =“C2”)
M. SELECT S
N. FROM SCWHERE C
O. =“C2” AND GRADE >= ALL(SELECT GRADEFROM SCWHERE C
P. =“C2”)

检索学生姓名和其所选修课程的课程号和成绩。正确的 SELECT 语句是。

A. SELECT S.SN, SC.C
B. , SC.GRADEFROM SWHERE S.S
C. =SC.S
D. SELECT S.SN, SC.C
E. , SC.GRADEFROM SCWHERE S.S
F. =SC.S
G. SELECT S.SN, SC.C
H. , SC.GRADEFROM S, SCWHERE S.S
I. =SC.S
J. SELECT S.SN, SC.C
K. , SC.GRADEFROM S, SC

检索选修 4 门以上的课程的学生总成绩(不统计不及格的课程),并要求按总成绩的降序排列出来。正确的 SELECT 语句是。

A. SELECT S
B. , SUM (GRADE)FROM SCWHERE GRADE>=60GROUP BY S
C. ORDER BY 2 DESCHAVING COUNT (*) >=4
D. SELECT S
E. , SUM (GRADE)FROM SCWHERE GRADE>=60GROUP BY S
F. HAVING COUNT (*) >=4ORDER BY 2 DESC
G. SELECT S
H. , SUM (GRADE)FROM SCWHERE GRADE>=60HAVING COUNT (*) >=4GROUP BY S
I. ORDER BY 2 DESC
J. SELECT S
K. , SUM (GRADE)FROM SCWHERE GRADE>=60ORDER BY 2 DESCGROUP BY S
L. HAVING COUNT (*) >=4

答案查题题库