Your question is Retention Cohort SQL. 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.
Rippling Operations needs a monthly retention cohort view for active platform accounts using account activation and activity records. Write a PostgreSQL query that shows how many accounts from each activation cohort were active in each subsequent month.
status is active and whose activation date is known.activated_at.| Column | Type | Description |
|---|---|---|
| account_idPK | INTEGER | Unique platform account identifier |
| account_name | VARCHAR(100) | Platform account name |
| activated_at | DATE | Date the account became active |
| status | VARCHAR(20) | Current account status |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INTEGER | Unique activity record identifier |
| account_id | INTEGER | Related account identifier |
| activity_at | DATE | Date of account activity |