Write a query to calculate the retention rate of users on a daily basis.
Treat each user's signup date as their cohort date. For each cohort and qualifying activity date, calculate retention as distinct active users divided by the total users who signed up on that cohort date. Ignore activity before signup and activity records that cannot be linked to a user.
cohort_date, activity_date, days_since_signup, cohort_users, retained_users, and retention_rate.cohort_date, then activity_date.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity record identifier |
| user_id | INT | User associated with the activity |
| activity_date | DATE | Date on which the activity occurred |