Listeners who played no jazz in June
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.
| int | Unique id. | |
| date | Day they joined. | |
| text | Two-letter country code. | |
| text | free, premium or family. |
artists30 rows in the sample
One row per artist. Key: artist_id.
| int | Unique id. | |
| text | Name. | |
| text | pop, rock, hip-hop, electronic, jazz or folk. |
tracks116 rows in the sample
One row per track. Key: track_id.
| int | Unique id. | |
| text | Track title. | |
| int | Main artist. | |
| int | Length. | |
| date | Release day. |
plays6,555 rows in the sample
One row per play. Key: play_id.
| bigint | Unique id. | |
| int | Who listened. | |
| int | What. | |
| timestamp | Start time (UTC). | |
| int | How long they listened. | |
| text | phone, desktop, speaker or car. |
Related questions
- Customers with no completed order in Marcheasy
- New riders with no completed trip in their first 14 dayshard
- Agents who got no urgent ticket in Aprileasy
- Campaigns that never brought in a paying usereasy
- Customers with savings but no open checking accountmedium
- Products that sold but were never returnedeasy
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL