YouTube wants to identify daily active users who explored a broad range of content. Write a SQL query to find users who watched videos from at least three distinct categories during the previous calendar day.
user_id, username, and category_count.user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique YouTube user identifier |
| username | VARCHAR(100) | Display name of the user |
| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique video category identifier |
| category_name | VARCHAR(100) | Name of the video category |
| Column | Type | Description |
|---|---|---|
| video_idPK | INT | Unique YouTube video identifier |
| video_title | VARCHAR(200) | Title of the video |
| category_id | INT | Category assigned to the video |
| Column | Type | Description |
|---|---|---|
| watch_idPK | INT | Unique viewing event identifier |
| user_id | INT | User who watched the video |
| video_id | INT | Video that was watched |
| watched_at | TIMESTAMP | Timestamp when the watch occurred |