Thumbtack’s Marketing Analytics team wants to measure how consistently service professionals who joined the platform in 2024 remain active. Write a PostgreSQL query that calculates month-over-month retention by join-month cohort.
joined_at date falls in 2024.cohort_month, activity_month, previous_month_active, retained_professionals, and retention_rate, in that order.cohort_month ascending, then activity_month ascending.retention_rate as a percentage multiplied by 100 and rounded to 2 decimal places.NULL for retention_rate when previous_month_active is 0.| Column | Type | Description |
|---|---|---|
| professional_idPK | INT | Unique service professional identifier |
| professional_name | VARCHAR(100) | Professional display name |
| joined_at | DATE | Date the professional joined Thumbtack |
| city | VARCHAR(80) | Primary service city |
| specialty | VARCHAR(100) | Primary service category |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity record identifier |
| professional_id | INT | References service_professionals.professional_id |
| activity_at | DATE | Date of activity on Thumbtack |
| activity_type | VARCHAR(40) | Type of professional activity |