Module 2 ยท SQL โ asking the database directly Lesson 5 of 15
GROUP BY and the aggregate functions
COUNT, SUM, AVG, MIN and MAX summarise many rows into one. GROUP BY says what "per" means in your question.
Worked example
SELECT month, SUM(amount) FROM sales GROUP BY month ORDER BY month โ and swapping SUM for COUNT answers a completely different question, which is why the plain-English version matters.
Your practice task
Write one query per business question: total per month, average per category, count per city, and the single worst-performing month.
Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.
Key takeaway
COUNT, SUM, AVG, MIN and MAX summarise many rows into one. GROUP BY says what "per" means in your question.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
Almost there
15 lessons left of 15
Finish every lesson to unlock the certificate. Each one ends in a practice task โ do them and the final project brief writes itself.