在MySQL中,可以使用聚合函数和GROUP BY子句对成绩(score)进行统计分析。以下是一些常见的统计分析方法:
SELECT AVG(score) as average_score FROM your_table;
SELECT MIN(score) as min_score, MAX(score) as max_score FROM your_table;
SELECT SUM(score) as total_score FROM your_table;
SELECT
CASE
WHEN score BETWEEN 0 AND 59 THEN '0-59'
WHEN score BETWEEN 60 AND 79 THEN '60-79'
WHEN score BETWEEN 80 AND 99 THEN '80-99'
ELSE '100'
END as score_range,
COUNT(*) as count
FROM your_table
GROUP BY score_range;
SELECT class, AVG(score) as average_score, MIN(score) as min_score, MAX(score) as max_score
FROM your_table
GROUP BY class;
请将your_table
替换为你的表名,并根据需要调整查询语句。