Practice · medium · dataset: ecom
Customers per order status
For each order status, count how many distinct customers have at least one order in that status.
Return status and customer_count, sorted by status ascending.
Tables available
| Table | Columns |
|---|---|
orders |
order_id, customer_id, order_date, status, channel |
A customer can appear in more than one status group; that is expected. The count within a group must not double-count a customer who has multiple orders in that status.
⌘/Ctrl + Enter to grade
Write a query, then grade it.
Hints
Try it first. Reveal a hint only when you are stuck.