Write a SQL query to compare monthly user counts and growth rates.
Use the user activity records to calculate distinct active users by calendar month. Include the previous month's count and the percentage change from the previous month.
month, monthly_user_count, previous_month_count, and growth_rate_pct| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| VARCHAR(255) | User email address | |
| created_at | TIMESTAMP | User registration timestamp |
| 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 |