Auto commit

This commit is contained in:
2025-02-25 18:43:00 +08:00
parent d44aeed220
commit 5627a1c82e
+70 -8
View File
@@ -340,11 +340,10 @@ GROUP BY c.id
ORDER BY AVG(sc.score) DESC;
#14. ID name>=6070-8080-90>=90
SELECT c.id '课程ID', c.`name` '课程名称', MAX(s.score) '最高分', MIN(s.score) '最低分', ROUND(AVG(s.score), 1) '平均值'
FROM scores s, courses c
WHERE s.course_id = c.id
GROUP BY c.id;
SELECT c.id '课程ID', c.`name` '课程名称', MAX(s.score) '最高分', MIN(s.score) '最低分', ROUND(AVG(s.score), 1) '平均值',
s2.s1 '及格率', s2.s2 '中等率', s2.s3 '优良率', s2.s4 '优秀率'
FROM scores s, courses c,
(
SELECT s.course_id,
CONCAT(TRUNCATE(COUNT(IF(s.score >=60, TRUE, NULL))/sc.count*100,2), '%') s1,
CONCAT(TRUNCATE(COUNT(IF(s.score >=70 AND s.score < 80, TRUE, NULL))/sc.count*100,2), '%') s2,
@@ -356,12 +355,75 @@ FROM scores s, (
GROUP BY course_id
) sc
WHERE s.course_id = sc.course_id
GROUP BY s.course_id;
GROUP BY s.course_id
)s2
WHERE s.course_id = c.id AND c.id = s2.course_id
GROUP BY c.id;
#15. Score
#15.1 Score
#16.
#16.1
#17.[100-85][85-70][70-60][60-0]
#18.
#19.
#20.
#21.
#22.
#23.
#24. 1990
#25.
#26. 85
#27. 60
#28.
#29. 70
#30.
#31. 01 80
#32.
#33.
#34.
#35.
#36.
#37. 5
#38.
#39.
#40.
#41. <
#42.
#43.
#44.
#45.
```