查询每个学生及其选修课程的情况(不包括没有选修课程的学生),以下语句正确的为()(SQLSERVER平台中)
A: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentrightjoinscon(student.sno=sc.sno)
B: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentleftjoinscon(student.sno=sc.sno)
C: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentrightoutjoinscon(student.sno=sc.sno)
D: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM scleft outjoin Studenton(student.sno=sc.sno)
A: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentrightjoinscon(student.sno=sc.sno)
B: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentleftjoinscon(student.sno=sc.sno)
C: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM Studentrightoutjoinscon(student.sno=sc.sno)
D: SELECT Student.Sno,Sname,Ssex,Sage,Sdept,Cno,scoreFROM scleft outjoin Studenton(student.sno=sc.sno)
举一反三
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,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);
- 查询每个学生的学号、姓名、选修的课程名及成绩,下列()的操作是正确的。 A: select student,sno,sname,grade from student,sc where student.sno=sc.sno and sc.cno=course.cno B: select student,sno,sname,grade from student,sc,cource where student.sno=sc.sno C: select student,sno,sname,grade from student,sc,cource where sc.cno=course.cno D: select student,sno,sname,grade from student,sc,cource where student.sno=sc.sno and sc.cno=course.cno
- 【多选题】针对学生选课数据库S_T,以下()操作实现了student表与sc之间的自然连接。 A. select student.* , cno, grade from student join sc on student.sno=sc.sno B. select student.* , sc.* from student , sc where student.sno=sc.sno C. select student.sno, sname, ssex, sage, sdept , cno, grade from student , sc where student.sno=sc.sno D. select student.* , cno, grade from student , sc where student.sno=sc.sno
- 下列SQL语句中,_________可以在“学生-课程”数据库正确实现“查询所有选修了1号课程的学生姓名”。 A: SELECT SnameFROM Student, SCWHERE SC.Cno= '1' B: SELECT SnameFROM Student, SCWHERE Student.Sno=SC.Sno AND SC.Cno= 1 C: SELECT Sname FROM Student WHERE Sno= (SELECT Sno FROM SC WHERE Cno= '1') D: SELECT Sname FROM Student WHERE EXISTS (SELECT * FROM SC WHERE Sno=Student.Sno AND Cno= '1')
- 下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“查询选修2号课程且成绩在90分以上的所有学生的学号和姓名”。 A: SELECT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno ANDSC.Cno= ‘2’ AND SC.Grade > 90 B: SELECT Student.Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno ANDSC.Cno=‘2’AND SC.Grade > 90 C: SELECT Sno, Sname FROM Student, SC WHERE SC.Cno=‘2’AND SC.Grade > 90 D: SELECT Student.Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno AND SC.Grade > 90