查询计算机系任意学生选修过的课程号,可以使用如下语句:SELECT DIST...HERE Sdept = 'CS');
举一反三
- 查询计算机系任意学生选修过的课程号,可以使用如下语句:SELECT DISTINCT CnoFROM SCWHERE Sno IN (SELECT SnoFROM StudentWHERE Sdept = 'CS');
- 查询计算机系任意学生选修过的课程号,不正确的查询语句是: A: SELECT DISTINCT CnoFROM SCWHERE NOT EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SSno = Student.Sno); B: SELECT DISTINCT CnoFROM SCWHERE EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SSno = Student.Sno); C: SELECT DISTINCT CnoFROM SCWHERE Sno IN (SELECT SnoFROM StudentWHERE Sdept = 'CS'); D: SELECT DISTINCT CnoFROM SCLEFT JOIN StudentON SSno = Student.SnoWHERE Sdept = 'CS';
- 查询计算机系任意学生选修过的课程号,不正确的查询语句是: A: SELECT DISTINCT CnoFROM SCWHERE NOT EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SC.Sno = Student.Sno); B: SELECT DISTINCT CnoFROM SCWHERE EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SC.Sno = Student.Sno); C: SELECT DISTINCT CnoFROM SCWHERE Sno IN (SELECT SnoFROM StudentWHERE Sdept = 'CS'); D: SELECT DISTINCT CnoFROM SCLEFT JOIN StudentON SC.Sno = Student.SnoWHERE Sdept = 'CS';
- 查询非计算机系中比计算机系中年龄最小者年龄大或相等的学生姓名,不正确的查询语句是: A: SELECT SnameFROM Student S1WHERE NOT EXISTS (SELECT *FROM Student S2WHERE S2.Sdept = 'CS'AND S1.Sage ;= S2.Sage)AND Sdept != 'CS'; B: SELECT SnameFROM StudentWHERE Sage >;= (SELECT MIN(Sage) FROMStudentWHERE Sdept = 'CS')AND Sdept != 'CS'; C: SELECT SnameFROM StudentWHERE Sage >;= ANY (SELECT SageFROM StudentWHERE Sdept = 'CS')AND Sdept != 'CS';
- 选择题:在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: A: SELECT SnameFROM StudentWHERE Sage >; (SELECT AVG(Sage)FROM Student);WHERE Sdept = 'CS' B: SELECT SnameFROM StudentWHERE Sage >; AVG(SELECT SageFROM StudentWHERE Sdept = 'CS'); C: SELECT SnameFROM StudentWHERE Sage >; (SELECT AVG(Sage)FROM StudentWHERE Sdept = 'CS'); D: SELECT SnameFROM StudentWHERE AVG(Sage) >; (SELECT SageFROM StudentWHERE Sdept = 'CS');