Practice · medium · dataset: ecom
Signup cohort activity
Group customers by the month they signed up. For each cohort month, report the number of customers and the total number of orders those customers placed.
Return cohort_month (the first day of the month), customers, and orders. Sort by
cohort_month ascending.
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 signup cohort. A cohort with no orders should still appear, with an order count of 0.
⌘/Ctrl + Enter to grade
Write a query, then grade it.
Hints
Try it first. Reveal a hint only when you are stuck.