Your question is Onboarding Retention SQL. Start with the requirements and the three 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.
Write a SQL query to calculate the retention rate of users who completed the onboarding flow versus those who did not at Superhuman.
Use the signup date as the cohort start. Define a retained user as someone with at least one activity between 30 and 59 days after signup, inclusive. Treat users without a completion event as not completed.
onboarding_status, eligible_users, retained_users, and retention_rate.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Superhuman user identifier |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique onboarding event identifier |
| user_id | INT | User associated with the onboarding event |
| event_type | VARCHAR(30) | Onboarding event type |
| occurred_at | DATE | Date the onboarding event occurred |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity identifier |
| user_id | INT | User associated with the activity |
| activity_type | VARCHAR(30) | Type of Superhuman activity |
| activity_date | DATE | Date the user was active |