Use GROUP BY with COUNT to roll up customer headcount by region. The two-column 'pivot table' that every executive review starts with — sized appropriately for a board-deck snapshot of where the customer base lives.
Board prep ask. Roll up the customer file by country. I want one row per country with the customer count, ordered by count descending so I can paste it straight into the deck. Use `ecom_customers`. The CEO wants to know how concentrated US-vs-international actually is — we keep saying 'we're a US brand' and I'm not sure that's still true.
| Column | Type | Key |
|---|---|---|
| customer_id | INT | PK |
| TEXT | ||
| first_name | TEXT | |
| last_name | TEXT | |
| accepts_marketing | INT | |
| country | TEXT | |
| created_date | TEXT | |
| total_orders | INT | |
| total_spent | REAL |
Each hint you reveal reduces the XP you can earn. Try the query first.
GROUP BY collapses rows that share a value. You want one row per country with a count alongside.
`SELECT country, COUNT(*) AS customer_count FROM ecom_customers GROUP BY country ORDER BY customer_count DESC` is the shape.
You should see eleven rows. US is the biggest by a wide margin; the long tail is European and Japanese customers.