Practice · easy · dataset: ecom
Orders per country
Operations wants to know which markets are actually placing orders, not just signing up. For each country, count how many orders were placed by customers in that country.
Return two columns: country and orders. Sort by order count from highest to lowest, and break
ties by country name in ascending order.
Tables available
| Table | Columns |
|---|---|
customers |
customer_id, email, country, signup_date |
orders |
order_id, customer_id, order_date, status, channel |
Every customer belongs to exactly one country. Count all orders regardless of status.
⌘/Ctrl + Enter to grade
Write a query, then grade it.
Hints
Try it first. Reveal a hint only when you are stuck.