SQL统计平均分大于70的学生成绩记录
SELECT s.id AS '学生学号', SUM(sc.score) AS '总分', AVG(sc.score) AS '平均分', COUNT(sc.course_id) AS '课程门数', MAX(sc.score) AS '课程最高分', MIN(sc.score) AS '课程最低分' FROM student s JOIN score sc ON s.id = sc.student_id GROUP BY s.id HAVING AVG(sc.score) > 70;
原文地址: https://www.cveoy.top/t/topic/jzl2 著作权归作者所有。请勿转载和采集!