设有学生表S(SNO,SN)(SNO为学生号,SN为姓名)和学生选修课程表SC(SNO,CNO,CN,G)(CNO为课程号,CN为课程名,G′为成绩),试用SQL语句完成以下操作:
(1)建立一个视图V—SSC(SNO,SN,CNO,CN,G),并按CNO升序排序。
(2)从视图V—SSC上查询平均成绩在90分以上的SN,CN和G。
(1)CREATE VIEW V-SSC(SNO,SN,CNO,CN,G) AS SELECT S.SNO,S.SN,SC.CNO,SC.CN,SC.G FROM S,SC WHERE S.SNO=SC.SNO ORDER BY CNO: (2)SELECT SN,CN,G FROM V-SSC GROUP BY SNO HAVING AVG(G)>90;