在MySQL中,可以使用聚合函數(shù)和GROUP BY子句對(duì)成績(jī)(score)進(jìn)行統(tǒng)計(jì)分析。以下是一些常見的統(tǒng)計(jì)分析方法:
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;
請(qǐng)將your_table
替換為你的表名,并根據(jù)需要調(diào)整查詢語句。