查询选修了课程号为'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 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' )
举一反三
- 查询选修了课程号为C2的学生号和姓名,用下列SQL的SELECT语句表达时,哪一个是错误的( ) A: SELECT S.S#,SNAME FROM S WHERE S.S# B: =(SELECT SC) S# FROM SC WHERE C#=‘C2’) C: SELECT S.S#,SNAME FROMS,SC D: WHERE S.S# S E: S# AND C#=‘C2’C) SELECT S. S#,SNAME FROM S,SC F: WHERE S.S# SC) S# AND C#=‘C2’ORDER BY S.S# G: SELECT S.S#,SNAME FROM S
- 查询选修了课程号为“C1”的学生的姓名和年龄,若用下列SQL的SELECT语句表达时,错误的是( )。 A: SELECT SNAME,AGE FROM S WHERE B: S#=(SELECT S C: S#FROM SC WHERE D: C#='C1') E: SELECT SNAME,AGE FROM S,SC WHERE F: S#=S G: S# AND S H: C#='C1' I: SELECT SNAME,AGE FROM S,SC WHERE J: S#=S K: S# AND S L: C#='C1' ORDERBY M: S# N: SELECT SNAME,AGE FROM S WHERE O: S#=(SELECT S P: S# FROM SC WHERE S Q: C#='C1')
- 有学生表S(S#,SN,SEX,AGE,DEPT),课程表C(C#,CN),学生选课表SC(S#,C#,GRADE),检索选修课程"C2"的学生中成绩最高的学生的学号,正确的SELECT语句是_________。 A: SELECT S# FROM SCWHERE C#="C2" AND GRADE>=(SELECT GRADE FROM SC WHERE C#="C2") B: SELECT S# FROM SCWHERE C#="C2" AND GRADE IN(SELECT GRADE FROM SC WHERE C#="C2") C: SELECT S# FROM SCWHERE C#="C2" AND GRADE NOT IN(SELECT GRADE FROM SC WHERE C#="C2") D: SELECT S# FROM SCWHERE C#="C2" AND GRADE>=ALL
- 查询选修了课程号为‘C2’的学生号和姓名,若用下列SQL的SELECT语句表达时, 是错误的? A: SELECT S.S B: ,SNAME FROM S WHERE S C: = (SELECT SS D: FROM SC WHERE C E: =‘C2’) F: SELECT S.S G: ,SNAME FROM S,SC WHERE S H: = SS I: AND C J: =‘C2’ K: SELECT S.S L: ,SNAME FROM S,SC WHERE S M: = SS N: AND C O: =‘C2' ORDER BY S P: Q: SELECT S.S R: ,SNAME FROM S WHERE S S: IN(SELECT SS T: FROM SC WHERE C U: =‘C2' )
- 若要求查找‘李’姓学生的学生号和姓名,正确的SQL语句是( )。 A: SELECT S#,SNAME FROM S WHERE SNAME=’李%’ B: SELECT S#,SNAME FROM S WHERE SNAME LIKE ’李%’ C: SELECT S#,SNAME FROM S WHERE SNAME=’%李%’ D: SELECT S#,SNAME FROM S WHERE SNAME LIKE ’%李%’