Intermediate
Case 30 of 50
Case 030: Signup Cohorts
customers
The growth team wants to see ByteMart's customer base by when people joined — the kind of question Alex would've had no idea where to start on a month ago. The manager passes along the request.
"Could you group everyone by the month they signed up? I'd like to see the cohort sizes."
The data Alex is looking at
customers
| id | name | country | signup_date |
|---|---|---|---|
| 1 | Sam | Germany | 2026-01-02 |
| 2 | Nina | Canada | 2026-01-05 |
| 3 | David | Germany | 2026-01-10 |
| 4 | Maya | Japan | 2026-01-15 |
| 5 | Daniel | Canada | 2026-01-20 |
| … 5 more rows | |||
TASK
Help Alex answer the manager:
“Show how many customers signed up in each calendar month.”
Write a query above and hit Run to see what comes back.
No hints requested yet — click "Get a hint" when you're stuck.
Alex's final query — this is for reference. Copy it into your own thinking, not into the editor above.
SELECT
DATE_FORMAT(signup_date, '%Y-%m') AS cohort_month,
COUNT(*) AS customers
FROM customers
GROUP BY cohort_month
ORDER BY cohort_month;
What that query returns
Case Debrief
Cohort grouping by signup period
- A "cohort" is just a group of customers who share a starting point in time — grouping by a formatted signup date is how cohort analysis begins.