SQL LEARNING PLATFORM
Aggregating by category — the analytics workhorse.
Learning Blocks
Interactive Queries
Concepts you'll master
How GROUP BY splits data into buckets before aggregating
Grouping by a single column
Grouping by multiple columns
Combining GROUP BY with WHERE
🌟 Think of it this way: GROUP BY is like sorting coins into labelled bags — all 1-rupee coins into one bag, all 5-rupee into another — and then counting each bag separately. Each bag becomes one row in your result.
SELECT department, COUNT(*) AS headcount, AVG(salary) AS avg_salary FROM employees GROUP BY department ORDER BY avg_salary DESC;
Practice your SQL skills