Skip to content

Plays in the first two weeks for April joiners

EasyFull bankJoinsDates and timeCohorts and retention12 min2 hidden datasets

The task

The growth team measures early engagement. Take every listener whose joined_on is in April 2025 (2025-04-01 to 2025-04-30 inclusive).

A play counts as an early play when it happened in the listener's first 14 days: from the start of the joining day up to, but not including, the start of the 14th day after it. In other words played_at >= joined_on and played_at < joined_on + 14 days.

Return listener_id and early_plays (the number of early plays, 0 if none) for each of those listeners. Sort by listener_id.

Expected output

listener_idearly_plays
  • Sorted by 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