Write a SQL query to join these tables and calculate the monthly retention rate.
Use the provided user and activity data. Treat a user as retained in a month when they have at least one activity record during that month.
cohort_month, activity_month, active_users, cohort_users, and retention_rate.cohort_month, then activity_month.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| signup_date | DATE | Date the user signed up |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity identifier |
| user_id | INT | User associated with the activity |
| activity_at | TIMESTAMP | Timestamp when the activity occurred |
| activity_type | VARCHAR(50) | Type of user activity |