查询学号为201215121的同学选修过的所有课程的名字,不正确的查询语句是:
A: SELECT CnameFROM CourseLEFT JOIN SCON Course.Cno = SCnoWHERE Sno = '201215121';
B: SELECT CnameFROM CourseWHERE Cno IN (SELECT CnoFROM SCWHERE Sno = '201215121');
C: SELECT CnameFROM CourseWHERE EXISTS (SELECT *FROM SCWHERE SCno = Course.CnoAND Sno = '201215121');
D: SELECT CnameFROM CourseWHERE NOT EXISTS (SELECT *FROM SCWHERE SCno = Course.CnoAND Sno = '201215121');
A: SELECT CnameFROM CourseLEFT JOIN SCON Course.Cno = SCnoWHERE Sno = '201215121';
B: SELECT CnameFROM CourseWHERE Cno IN (SELECT CnoFROM SCWHERE Sno = '201215121');
C: SELECT CnameFROM CourseWHERE EXISTS (SELECT *FROM SCWHERE SCno = Course.CnoAND Sno = '201215121');
D: SELECT CnameFROM CourseWHERE NOT EXISTS (SELECT *FROM SCWHERE SCno = Course.CnoAND Sno = '201215121');
举一反三
- 查询没有选修1号课程的学生姓名()。 A: select snamefrom student,scwhere student.sno=sc.sno and cno!='1' B: select snamefrom sno not in(select snofrom scwhere cno='1' ) C: select snamefrom sno in(select snofrom scwhere cno!='1' ) D: select snamefrom sno not exists(select*from scwhere student.sno and sc.sno and cno='1' )
- 查询选修了'数据库基础'课程的同学的学号,和这些同学选修的全部课程号和分数.select sno,cno,gradefrom ______________________ A: sc where sno in (select sno from sc join course on sc.cno=course.cno where cname='数据库基础') B: sc join course on sc.cno=course.cno where cname='数据库基础' C: sc where sno in (select sno from course where cname='数据库基础') D: sc where cno in (select cno from course where cname='数据库基础')
- 以下( )语句可查询选修了三门以上成绩在80分以上课程的学生学号。 A: select sno from scwhere grade>80group by snohaving count(cno)>3 B: select sno from scwhere grade>80group by snohaving count(*)>3 C: select sno from scwhere grade>80 and count(*)>3group by sno D: select sno from scwhere grade>80group by snohaving count(sno)>3
- 针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下( )语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select sno from scwhere grade>90group by snohaving count(cno)>2 B: select sno from scwhere grade>90group by snohaving count(*)>2 C: select sno from scwhere grade>90 and count(*)>2group by sno D: select sno from scwhere grade>90group by snohaving count(sno)>2
- 下列查询中,属于相关子查询的有()。 A: SELECT * FROM student WHERE sno IN (SELECT sno FROM sc WHERE cno='1'); B: SELECT sno, cno FROM SC x WEHRE grade>=(SELECT AVG(grade) FROM SC y WHERE y.sno = x.sno); C: SELECT sname FROM student WHERE EXISTS(SELECT * FROM sc WHERE sno=student.sno AND cno='1'); D: SELECT sname FROM student WHERE NOT EXISTS(SELECT * FROM course WHERE NOT EXISTS(SELECT * FROM sc WHERE sc.sno=student.sno AND sc.cno=course.cno));