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.

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.

viewer_idviewer_name
1Alice Morgan
3Chloe Dubois
5Emma Stone
PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid