The 2023 Cohort
Growth at Whetcode Supply runs a cohort study each year: take everyone who registered during one calendar year, follow them for twelve months, and see how many were still buying at the end. The 2023 cohort is next, and the study starts from the roll — the people in it, in the order they joined, so the first-registered is followed longest.
Registration dates are stored as text like 2023-04-27, not as a year on its own, so the cohort has to be picked out of the full-date column.
customers — one row per registered customer. city is the city given at signup and signup_date is the day they registered, written year-month-day.
| id | name | city | signup_date |
|---|---|---|---|
| 1 | Priya Nair | Austin | 2022-01-15 |
| 2 | Tom Becker | Berlin | 2022-03-02 |
| 3 | Sofia Rossi | Milan | 2022-05-19 |
| 4 | Liam OConnor | Dublin | 2023-01-08 |
| 5 | Wei Zhang | Austin | 2023-04-27 |
The table already exists in the database — there is nothing to create or load.
Task: Write a query returning two columns, name and signup_date, one row per customer who registered anywhere in the 2023 calendar year, earliest registration first. Return signup_date exactly as stored, in year-month-day text. No two customers registered on the same day, so the sequence is fully determined.
Example output — shape only, on invented customers. The dates are returned as stored, in year-month-day text:
| name | signup_date |
|---|---|
| Rosa Delgado | 2023-06-04 |
| Kenji Aoki | 2023-09-30 |
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in