Write a SQL query to extract user engagement metrics over a specific time frame.
Use the users and engagement_events tables for events from 2024-01-01 inclusive through 2024-01-08 exclusive. Include users with no events during the timeframe.
user_id, username, total_events, active_days, likes, comments, and shares.total_events descending, then user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| username | VARCHAR(100) | Display name of the user |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique engagement event identifier |
| user_id | INT | User associated with the event |
| occurred_at | TIMESTAMP | Timestamp when the event occurred |
| event_type | VARCHAR(20) | Engagement type, such as like, comment, or share |