How would you write a query to aggregate user interactions by hour?
Use the user_interactions table. Count interactions for each non-null timestamp hour and return the results in chronological order.
interaction_hour, interaction_countinteraction_hour ascending| Column | Type | Description |
|---|---|---|
| interaction_idPK | INT | Unique identifier for the interaction |
| user_id | INT | Identifier of the user who performed the interaction |
| interaction_timestamp | TIMESTAMP | Timestamp when the interaction occurred |
| interaction_type | VARCHAR(50) | Type of user interaction |