Documentary watchers
Documentary watchers
You work at the ReelFlow streaming service. The production team is launching a new documentary lineup and wants to send the announcement only to people who plausibly care: viewers who have already watched at least one title of the documentary genre. Watch events live in watch_history, profiles in viewers.
Build the mailing list using an EXISTS check: a viewer makes the list if they have at least one watch record with genre 'documentary'. Each viewer must appear exactly once, no matter how many documentaries they watched.
Return columns:
- viewer_id — the viewer's id;
- viewer_name — their name.
Sort by viewer_id ascending.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.
| viewer_id | viewer_name |
|---|---|
| 1 | Alice Morgan |
| 3 | Chloe Dubois |
| 5 | Emma Stone |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in