Your question is Window Functions for Retention. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ancestry wants to understand whether users who join in January 2024 continue using the Family Tree experience. Write a PostgreSQL query to calculate monthly retention for this signup cohort from January through March 2024.
signup_date falls in January 2024.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Ancestry user identifier |
| signup_date | DATE | Date the user created an Ancestry account |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique product event identifier |
| user_id | INT | User associated with the event |
| event_at | TIMESTAMP | Timestamp when the event occurred |
| surface | VARCHAR(50) | Ancestry product surface generating the event |