Write a SQL query to aggregate user data by month.
Use the users and user_events tables. Include only events with a non-null timestamp that belong to a known user.
month_start, active_users, total_events, and avg_events_per_user.month_start in ascending order.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| display_name | VARCHAR(80) | User display name |
| plan | VARCHAR(20) | Current subscription plan |
| created_at | DATE | Date the user account was created |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User associated with the event |
| event_type | VARCHAR(40) | Type of user event |
| occurred_at | TIMESTAMP | Timestamp when the event occurred |