Write a query to find the monthly active users who upgraded their subscription tier, showing the month-over-month growth rate.
Use user_activity records to identify active users and subscription_changes records to identify upgrades occurring in the same calendar month. Include only users active during the month of their upgrade.
month, monthly_active_upgraded_users, and mom_growth_rate_pct.NULL growth rate.| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity record identifier |
| user_id | INT | HubSpot user identifier associated with the activity |
| activity_at | TIMESTAMP | Timestamp when the user was active |
| Column | Type | Description |
|---|---|---|
| change_idPK | INT | Unique subscription change identifier |
| user_id | INT | HubSpot user identifier affected by the change |
| changed_at | TIMESTAMP | Timestamp when the subscription changed |
| change_type | VARCHAR(20) | Type of subscription change |
| old_tier | VARCHAR(30) | Subscription tier before the change |
| new_tier | VARCHAR(30) | Subscription tier after the change |