查询计算机系任意学生选修过的课程号,可以使用如下语句: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';
- 查询计算机系任意学生选修过的课程号,可以使用如下语句:SELECT DIST...HERE Sdept = 'CS');
- 下列SQL语句中,________可以在“学生-课程”数据库中实现“查询所有有成绩的学生学号和课程号”。 A: SELECT Sno,CnoFROM SCWHERE Grade NOT NULL B: SELECT Sno,CnoFROM SCWHERE Grade <> NULL C: SELECT Sno,CnoFROM SCWHERE Grade IS NOT NULL D: SELECT Sno,CnoFROM SCWHERE Grade >0
- 选择题:在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: 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');