101
0/304
Loading content...
A content platform stores article view events in a single fact table.
Table: views
Data notes:
Task:
Output requirements:
Supported submission environments:
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 1 | 3 | 5 | 2019-08-01 |
| 3 | 4 | 5 | 2019-08-01 |
| 1 | 3 | 6 | 2019-08-02 |
| 2 | 7 | 7 | 2019-08-01 |
| 2 | 7 | 6 | 2019-08-02 |
| 4 | 7 | 1 | 2019-07-22 |
| 3 | 4 | 4 | 2019-07-21 |
| 3 | 4 | 4 | 2019-07-21 |[
{"id":5},
{"id":6}
]Viewer 5 has two distinct articles on 2019-08-01. Viewer 6 has two distinct articles on 2019-08-02. Viewer 4 has duplicate rows for one article only and does not qualify.
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 10 | 10 | 10 | 2024-01-01 |
| 10 | 10 | 10 | 2024-01-01 |
| 11 | 11 | 10 | 2024-01-02 |[]The viewer reads one distinct article per day, so no viewer qualifies.
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 21 | 8 | 30 | 2024-03-15 |
| 22 | 9 | 30 | 2024-03-15 |
| 23 | 8 | 30 | 2024-03-15 |
| 24 | 1 | 31 | 2024-03-15 |
| 25 | 1 | 31 | 2024-03-16 |[
{"id":30}
]Viewer 30 has three distinct articles on one day and qualifies. Viewer 31 spreads activity across days and does not satisfy same-day multi-article rule.
Constraints