查询选修了课程号为“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')
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')
举一反三
- 查询选修了课程号为'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' )
- 查询选修了课程号为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
- 若要求查找“年龄大于18岁学生的学生号和姓名”,正确的SQL语句是( )。 A: SELECT S#,SNAME FROM S WHERE AGE>18 B: SELECT S#,SNAME FROM S WHERE AGE>=18 C: SELECT S#,SNAME FROM S WHERE AGE>’18’ D: SELECT S#,SNAME FROM S WHERE AGE>=’18’
- 假设数据库中有“学生(S)-选课(SC)-课程(C)”的三个关系:S(S#,SNAME,SEX,AGE) SC(S#,C#,GRADE) C(C#,CNAME,TEACHER) 若要求查找姓“王”的学生的学号和姓名。下面列出的 SQL 语句中正确的是______。Ⅰ.SELECT S#,SNAME FROM S WHERE SNAME=’王%’ Ⅱ.SELECT S#,SNAME FROM S WHERE SNAME LIKE ’王%’Ⅲ.SELECT S#,SNAME FROM S WHERE SNAME LIKE ’王_%’ A: Ⅰ B: Ⅱ C: Ⅲ D: 全部
- 有关系S(S#,SNAME,SAGE),C(C#,CNAME),SC(S#,C#,GRADE)。若要查找分数(grade)不及格的学生姓名(sname),则以上正确的有?( ) A: SELECT sname FROM s, sc WHERE grade<60 B: SELECT sname FROM s WHERE sno IN(SELECT Cno FROM sc WHERE grade<60) C: SELECT sname FROM s, sc WHERE s.sno=sc.sno AND grade<60 D: SELECT sname FROM s, sc WHERE s.sno=sc.sno OR grade<60