查询出第2学期(xq=2)各个学生所有课程的平均成绩的列表。所得查询结果如下: +--------------+----+----------+ | 学号 | xq | 平均成绩 | +--------------+----+----------+ | 200900020007 | 2 | 75.0000 | | 201000010001 | 2 | 56.0000 | | 201000010002 | 2 | 85.0000 | | 201000010003 | 2 | 64.0000 | | 201000010004 | 2 | 85.0000 | | 201000010005 | 2 | 78.0000 | | 201000010006 | 2 | 50.0000 | | 201000010007 | 2 | 79.0000 | | 201100010001 | 2 | 49.0000 | +--------------+----+----------+
A.
SELECT sno AS 学号,xq,AVG(cj) AS 平均成绩 FROM sc GROUP BY sno ;
B.
SELECT sno AS 学号,xq,AVG(cj) AS 平均成绩 FROM sc GROUP BY sno HAVING xq=2 ;
C.
SELECT sno AS 学号,xq,AVG(cj) AS 平均成绩 FROM sc WHERE xq=2 ORDER BY sno ;
D.
SELECT sno AS 学号,xq,AVG(cj) AS 平均成绩 FROM sc WHERE xq=2 GROUP BY sno ;