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

admin2013-03-26  45

问题 现有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 … FROM Table INNER|LEFT|RIGHT|FULL JOIN Table ON JionCondition。本题中使用了两个超链接,答案是A,其他选项的条件不正确。
转载请注明原文地址:https://kaotiyun.com/show/6fsp777K
0

随机试题
最新回复(0)