第4单元,设有学生表student(学号,姓名,系名,课程号,成绩),查询至少选修了4门课程的学生学号及平均成绩的正确语句是()


第4单元,设有学生表student(学号,姓名,系名,课程号,成绩),查询至少选修了4门课程的学生学号及平均成绩的正确语句是()

A.SELECT 学号, AVG(成绩) AS 平均成绩 FROM student GROUP BY 学号 HAVING COUNT(课程号)>3;

B.SELECT 学号, AVG(成绩) AS 平均成绩 FROM student GROUP BY 课程号 HAVING COUNT(课程号)>3;

C.SELECT 学号, AVG(成绩) AS 平均成绩 FROM student GROUP BY 学号 HAVING COUNT(课程号)>4;

D.SELECT 学号, AVG(成绩) AS 平均成绩 FROM student GROUP BY 课程号 HAVING COUNT(DISTINCT 学号)>3;

正确答案:SELECT 学号, AVG(成绩) AS 平均成绩 FROM student GROUP BY 学号 HAVING COUNT(课程号)>3;


Tag:数据库原理与应用 学号 成绩 时间:2022-01-17 13:13:55