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.
Exemplo de resposta esperada
É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema. Sua resposta precisa retornar os mesmos nomes de colunas do exemplo: use AS para renomeá-las se for preciso.
| profile_id | title_code |
|---|---|
| 101 | TT-DUNE |
| 101 | TT-FARGO |
| 101 | TT-OZARK |
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
Entrar