结构化查询语言SQL是一种______语言,其主要功能有______,它的典型句型为SELECT A1,A2,…,An FROM r1,r2,…,rm WHERE F 其中A1,A2,…,An和F分别是______。 关系模式SCS(Sno,Cno,Score)中,Sno是学生的学号,Cno是课程号,Score为成绩。若要查询每门课程的平均成绩,且要求查询结果按平均成绩升序排列。平均成绩相同时,按课程号降序排列,可用SQL语言写为______。若查询结果仅限于平均分数超过85分的,则应______。
A: SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno DESC
B: SEIECT Cno, AVG(Score) FROM SCS GROUP BY Cno ORDER BY 2, Cno DESC
C: SELECT Cno, AVG(Score) FROM SCS WHERE Cno, DESC GROUP BY Score
D: SELECT Cno, AVG(Score) FROM SCS GROU PBY, AVG(Score) ORDER BY, Cno DESC
A: SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno DESC
B: SEIECT Cno, AVG(Score) FROM SCS GROUP BY Cno ORDER BY 2, Cno DESC
C: SELECT Cno, AVG(Score) FROM SCS WHERE Cno, DESC GROUP BY Score
D: SELECT Cno, AVG(Score) FROM SCS GROU PBY, AVG(Score) ORDER BY, Cno DESC
举一反三
- A.SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno Desc B.SELECT Cno, AVG(Score) FROM SCS GROUP BY Cno ORDER BY 2, Cno Desc C.SELECT Cno, AVG(Score) FROM SCS WHERE Cno, Desc GROUP BY Score D.SELECT Cno, AVG(Score) FROM SCS GROUP BY, AVG(Score) ORDER BY, Cno Desc
- 设有关系模式xkb(学号,课程号,成绩),今要查询每门课程的平均成绩,且要求查询的结果按平均成绩降序排列,平均成绩相同的,按课程号升序排列,则下列正确的查询语句是( )。 A: select 课程号 ,avg(成绩) 平均成绩from xkbgroup by 课程号order by 2 desc,1 B: select 课程号 cno ,avg(成绩) avg_gradefrom xkbgroup by 课程号order by avg_grade desc, cno C: select 课程号 cno ,avg(成绩) avg_gradefrom xkbgroup by cnoorder by avg_grade desc, cno D: select 课程号 ,avg(成绩) 平均成绩from xkbgroup by 课程号order by 平均成绩 desc, 课程号
- 查询选课关系SC(Sno,Cno,Score)表中还没有给定成绩()的课程号()和学号(),下列语句正确的是。() A: SELECT<br/>Sno,Cno<br/>FROM SC WHERE Score IS NULL B: SELECT*<br/>FROM SC WHERE Score =NULL C: SELECT<br/>Sno,Cno<br/>FROM SC D: SELECT<br/>Score FROM SC WHERE Sno,Cno<br/>IS NOT NULL
- 完善以下SQL语句,在课程表CInfo(CNo,CName)、成绩表SCInfo(StID,CNo,Score)中,查询平均成绩在80分(含80)以上的课程名称与平均成绩,并按平均成绩降序排序。(注:使用大写字母答题)SELECT CName, AVG(Score) 平均成绩FROM CInfo c JOIN SCInfo sc ON c.CNo=sc.CNo GROUP BY CName__________ AVG(Score)>=80ORDER BY 平均成绩 DESC
- 成绩表 SCInfo(StId,CNo,Score) 的属性StId表示学号,CNo为课程编号,Score为成绩。从SCInfo表中找出无成绩的元组的SQL语句是( )。 A: SELECT * FROM SCInfo WHERE Score=NULL B: SELECT * FROM SCInfo WHERE Score IS '' C: SELECT * FROM SCInfo WHERE Score ='' D: SELECT * FROM SCInfo WHERE Score IS NULL