The Brief
Welcome back, it's John at Maven Analytics here again!
Yesterday you got your first data snapshot and discovered something Sarah didn't expect: the UK might not actually be Apex Retail's biggest market by revenue.
That's a perfect example of what good analysis does, it challenges assumptions before they become bad decisions. Today we answer Sarah's first real question.
The brief
Sarah walks over: "Before the leadership meeting, I need to know what's actually driving revenue. Which categories are performing, and which aren't?"
This is the most common business question a data analyst hears. The answer lives in GROUP BY. And most beginners misunderstand it, which is exactly what we're fixing today.
If you’ve ever used a Pivot Table in Excel, this will seem really familiar (and probably easier than you expected).
What GROUP BY actually does
Think of your 30-row orders table. Every row is one order. But Sarah doesn't want 30 rows, she wants one number per category. That's what GROUP BY does: it collapses rows that share a value into a single summary row, then lets you calculate a total, count, or average for each group.
The point is not to know this definition by heart. The point is to be able to look at a business question, "what's driving revenue by category?", and immediately know that GROUP BY category is the answer.