Aggregate Functions Together
COUNT, SUM, AVG, MIN and MAX summarise many rows into one.
Example
SELECT COUNT(score) AS n, SUM(score) AS total, ROUND(AVG(score),1) AS avg, MIN(score) AS lo, MAX(score) AS hi
FROM students;Result
n | total | avg | lo | hi 7 | 537 | 76.7 | 59 | 92
Exercise
Highest value.
SELECT (score) FROM students;
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.