Write a SQL query to compare the retention rate of users who completed onboarding versus those who did not.
Use a 30-day retention window, counting a user as retained if they have at least one activity after signup and within 30 days of signup. Exclude users whose onboarding status is unknown.
onboarding_status, total_users, retained_users, and retention_rate_pct.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| onboarding_completed | BOOLEAN | Whether the user completed onboarding |
| signup_date | DATE | User signup date |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity identifier |
| user_id | INT | User associated with the activity |
| activity_date | DATE | Date on which the activity occurred |