What was watched, without repeats
What was watched, without repeats
You work with the data of a streaming service. Plays are written into two tables: one for the browser web player, the other for the mobile app. The product team is building a "you have already watched this" block and asks for a directory of profile-to-title facts: which profile has ever started which title. How many times they rewatched it and on which device does not matter for this directory — every pair must appear exactly once.
Return columns:
- profile_id — viewer profile id (integer);
- title_code — title code.
Sorting: by profile_id ascending, then by title_code ascending. Each profile-title pair must land in the result exactly once, no matter how many times or on how many platforms it was played.
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.
| profile_id | title_code |
|---|---|
| 101 | TT-DUNE |
| 101 | TT-FARGO |
| 101 | TT-OZARK |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in