现有3个表Students(SID,SN,SEX,AGE,DEPT),Courses(CID,CNAME),SCORE(SID,CID,GRADE)。其中,SID为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,CID为课程号,CNAME为课

admin2013-11-12  17

问题 现有3个表Students(SID,SN,SEX,AGE,DEPT),Courses(CID,CNAME),SCORE(SID,CID,GRADE)。其中,SID为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,CID为课程号,CNAME为课程名,GRADE为成绩。检索“王华”同学所选修的课程名称和成绩,正确的SELECT语句是(    )。

选项 A、SELECT CNAME,GRADE.FROM Students INNER JOIN SCORE ON Students.SID=SCORE.SID INNER JOIN Courses ON SCORE.CID=Courses.CID WHERE SN=‘王华’
B、SELECT CNAME,GRADE FROM Students INNER JOIN Courses ON Students.SID=Courses.CID WHERE SN=‘王华’
C、SELECT CNAME,GRADE FROM SCORE INNER JOIN Courses ON SCORE.CID=Courses.CID WHERE CNAME=‘王华’
D、SELECT CNAME,GRADE FROM Students INNER JOIN Courses ON Students.SN=Courses.CNAME WHERE SN=‘王华’

答案A

解析 超链接的语法格式是:SELECT…FROMTable INNER|LEFT|RIGHT|FULL JOIN Table ON JionCondition。本题中使用了两个超链接,答案是A,其他答案的条件不正确。   
转载请注明原文地址:https://kaotiyun.com/show/Ofop777K
0

最新回复(0)