Skip to content

Artist catalog size and 2025 releases

MediumFull bankGroup and aggregateJoinsDates and time14 min2 hidden datasets

The task

The label relations team wants a status line for every artist: how big the catalog is, and how much of it is new this year.

Return one row for every artist in artists, including artists with no tracks:

  • artist_id
  • artist_name
  • tracks: the number of tracks the artist has
  • tracks_2025: the number of tracks with released_on on or after 2025-01-01
  • latest_release: the latest released_on date over all the artist's tracks, or NULL if the artist has none
  • latest_2025_release: the latest released_on date among the 2025 tracks, or NULL if there are none

Sort by tracks_2025 descending, then artist_id ascending.

Expected output

artist_idartist_nametrackstracks_2025latest_releaselatest_2025_release
  • Sorted by tracks_2025 descending, then artist_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