下面哪一条语句是正确的()
A: select from b
B: select sno from a where sno 2000
C: select * from a order by sno where age>20
D: select * from B group by cno where cno>1
A: select from b
B: select sno from a where sno 2000
C: select * from a order by sno where age>20
D: select * from B group by cno where cno>1
举一反三
- 检索选修了课程”C1”的学生中成绩最高的学生的学号,正确的SELECT语句为( ) A: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE >=ALL (SELECT Grade FROM SC WHERE Cno=’C1’); B: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE IN (SELECT Grade FROM SC WHERE Cno=’C1’); C: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE > ANY (SELECT Grade FROM SC WHERE Cno=’C1’); D: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE >= (SELECT Grade FROM SC WHERE Cno=’C1’);
- 没有选修c01课程同学的学号 SELECT<br/>sno FROM student WHERE<br/>_______________ A: cno<>'c01' B: cno!='c01' C: sno<br/>not in(SELECT sno FROM sc WHERE cno='c01') D: NOT<br/>EXISTS(SELECT * FROM sc WHERE cno='c01'AND student.sno=sno)
- 下列查询中,属于相关子查询的有()。 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));
- 查询所有有成绩的学生学号和课程号。正确的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
- 以下命令是相关子查询的嵌套查询是: A: SELECT * FROM student WHERE sno IN (SELECT sno FROM sc WHERE cno = '1') B: SELECT * FROM student WHERE EXISTS (SELECT * FROM sc WHERE cno = '1' AND sc.sno = student.sno) C: SELECT sno, cno FROM sc x WHERE grade>(SELECT AVG(grade) FROM sc y WHERE y.sno = x.sno) D: 以上都是