Skip to content

Listeners who played no jazz in June

MediumFreeRows with no matchJoinsDates and time15 min2 hidden datasets

The task

The playlist team is building a jazz win-back campaign. It targets listeners who did not play any jazz in June 2025.

A jazz play is a play of a track whose artist has genre = 'jazz'. June 2025 runs from 2025-06-01 00:00 up to, not including, 2025-07-01 00:00. Only consider listeners who joined before 2025-06-01 (joined_on). Listeners with no plays at all in June belong on the list, and so do listeners who played only other genres.

Return listener_id, plan and june_plays (the number of plays of any genre by that listener in June, 0 if none). Sort by june_plays descending, then listener_id.

Expected output

listener_idplanjune_plays
  • Sorted by june_plays descending, then listener_id ascending.
  • Checked on the sample and on 2 hidden datasets. How grading works

Tables Music streaming service · click a name to insert it

listeners180 rows in the sample

One row per listener account. Key: listener_id.

intUnique id.
dateDay they joined.
textTwo-letter country code.
textfree, premium or family.
artists30 rows in the sample

One row per artist. Key: artist_id.

intUnique id.
textName.
textpop, rock, hip-hop, electronic, jazz or folk.
tracks116 rows in the sample

One row per track. Key: track_id.

intUnique id.
textTrack title.
intMain artist.
intLength.
dateRelease day.
plays6,555 rows in the sample

One row per play. Key: play_id.

bigintUnique id.
intWho listened.
intWhat.
timestampStart time (UTC).
intHow long they listened.
textphone, desktop, speaker or car.

Related questions

Loading the editor and PostgreSQL