Artist catalog size and 2025 releases
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_idartist_nametracks: the number of tracks the artist hastracks_2025: the number of tracks withreleased_onon or after 2025-01-01latest_release: the latestreleased_ondate over all the artist's tracks, or NULL if the artist has nonelatest_2025_release: the latestreleased_ondate 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.
| 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
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL