查询曾经考过100分的学生的学号,可以使用的SQL语句是:( )
A: SELECT ALL Sno FROM SC WHERE Grade = 100;
B: SELECT DISTINCT Sno FROM SC WHERE Grade = 100;
C: SELECT ALL Sno FROM Student WHERE SGrade = 100;
D: SELECT DISTINCT Sno FROM Student WHERE SGrade = 100;
A: SELECT ALL Sno FROM SC WHERE Grade = 100;
B: SELECT DISTINCT Sno FROM SC WHERE Grade = 100;
C: SELECT ALL Sno FROM Student WHERE SGrade = 100;
D: SELECT DISTINCT Sno FROM Student WHERE SGrade = 100;
举一反三
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,SQL语句可为( ) A: SELECT DISTINCT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; B: SELECT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; C: SELECT DISTINCT Sno, DISTINCT Sname FROM Student WHERE Student.Sno IN (SELECT Sno FROM SC); D: SELECT Sno, Sname FROM Student WHERE Student.Sno IN (SELECT DISTINCT Sno FROM SC);
- 列出SC表中所有考试不及格的学生的学号Sno(无须重复),其SQL语句为( ) A: SELECT DISTINCT Sno FROM SC WHERE Grade<60; B: SELECT DISTINCT Sno FROM SC WHERE Grade IS NULL; C: SELECT Sno FROM SC WHERE Grade<60; D: SELECT ALL Sno FROM SC WHERE Grade<60;
- 若查询考试成绩不为空的学生的学号,下列语句哪个是正确的?( ) A: SELECT Sno FROM SC WHERE Grade >= 0; B: SELECT Sno FROM SC WHERE Grade != 0; C: SELECT Sno FROM SC WHERE Grade IS NOT NULL; D: SELECT Sno FROM SC WHERE Grade NOT IS NULL;
- 若查询考试成绩不为空的学生的学号,下列语句哪个是正确的? A: SELECT Sno FROM SC WHERE Grade >= 0; B: SELECT Sno FROM SC WHERE Grade!= 0; C: SELECT Sno FROM SC WHERE Grade NOT IS NULL; D: SELECT Sno FROM SC WHERE Grade IS NOT NULL;
- 检索选修了课程”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’);