有关系S(SNO, SNAME, SAGE),C(CNO, CNAME),SC(SNO, CNO, GRADE)。其中SNO是学生号,SNAME是学生姓名,SAGE是学生年龄, CNO是课程号,CNAME是课程名称,GRADE是成绩。以下( )SQL语句可以实现查询选修了'C002'号课程的学生姓名。
A: SELECT SNAME FROM S, SC WHERE S.SNO=SC.SNO AND CNO='C002'
B: SELECT SNAME FROM S WHERE SNO IN (SELECT SNO FROM SC WHERE CNO='C002')
C: SELECT SNAME FROM S WHERE SNO = (SELECT SNO FROM SC WHERE CNO='C002')
D: SELECT SNAME FROM S WHERE SNO NOT IN (SELECT SNO FROM SC WHERE CNO='C002')
A: SELECT SNAME FROM S, SC WHERE S.SNO=SC.SNO AND CNO='C002'
B: SELECT SNAME FROM S WHERE SNO IN (SELECT SNO FROM SC WHERE CNO='C002')
C: SELECT SNAME FROM S WHERE SNO = (SELECT SNO FROM SC WHERE CNO='C002')
D: SELECT SNAME FROM S WHERE SNO NOT IN (SELECT SNO FROM SC WHERE CNO='C002')
举一反三
- 查询所有有成绩的学生学号和课程号。正确的SELECT语句是()。 A: Select sno , cno from sc where grade < > null B: Select sno as 学号, cno as 课程号 from sc where grade is not null C: Select sno , cno from sc where grade !=‘ ’ D: Select sno , cno from sc where grade is not null
- 已知学生选课信息表:sc(sno,cno,grade)。查询“至少选修了一门课程,但没有学习成绩的学生学号和课程号”的SQL语句是( )。 A: SELECT sno,cno FROM sc WHERE grade=NULL B: SELECT sno,cno FROM sc WHERE grade IS C: SELECT sno,cno FROM sc WHERE grade IS NULL D: SELECT sno,cno FROM sc WHERE grade=
- 基于学生—选课—课程数据库中的三个基本表:学生的信息表:STUDENT(sno, sname, sex, age, dept)主码为sno课程信息表:COURSE(cno,cname, teacher)主码为cno学生选课信息表:SC(sno, cno, grade)主码为(sno, cno) “查询没有学习成绩的学生的学号和课程号”的SQL语句是()。 A: SELECT sno, cno FROM SC WHERE grade=NULL B: SELECT sno, cno FROM SC WHERE grade IS" C: SELECT sno, cno FROM SC WHERE grade IS NULL D: SELECT sno, cno FROM SC WHERE grade="
- “查询没有学习成绩的学生的学号和课程号”的SQL语 句是( ) (2.0) A: SELECT sno,cno FROM SC WHERE grade = NULL B: SELECT sno,cno FROM SC WHERE grade IS ' ' C: SELECT sno,cno FROM SC WHERE grade IS NULL D: SELECT sno,cno FROM SC WHERE grade = ' '
- 设有关系S(SNO, SNAME, SEX), C(CNO, CNAME), SC(SNO, CNO, GRADE)。其中SNO为学生号,SNAME为学生姓名,SEX为性别,CNO为课程号,CNAME为课程名。若要求查找姓名中第一个字为“王”的学生号和姓名。下面列出的SQL语句中,哪个(些)是正确的______ Ⅰ.SELECT SNO, SNAME FROM S WHERE SNAME=“王%” Ⅱ.SELECT SNO, SNAME FROM S WHERE SNAME LIKE“王%” Ⅲ.SELECT SNO, SNAME FROM S WHERE SNAME LIKE“王” A: Ⅰ B: Ⅱ C: Ⅲ D: 全部