Back to questions

SQL Tutorial Lesson: Album Releases SQL Interview Question

SQL Tutorial Lesson: Album Releases

SQL Interview Question

As the lead data analyst for a prominent music event management company, you have been entrusted with a dataset containing concert revenue and detailed information about various artists.

Write a query that categorizes the artists based on their album release count. Display the output of the artist name, and album categort, sorted in ascending order of the artist's name.

The album category will be based on the number of albums released by the artists or bands:

  • If an artist has released 7 or more albums, they fall under the "Platinum" category.
  • If an artist has released between 3 and 6 albums (inclusive), they fall under the "Gold" category.
  • If an artist has released 2 or fewer albums, they fall under the "Silver" category.

Schema:

Column NameTypeDescription
artist_idintegerA unique identifier for each artist or band performing in the concert.
artist_namevarchar(100)The name of the artist or band performing in the concert.
genrevarchar(50)The music genre associated with the concert.
concert_revenueintegerThe total revenue generated from the concert.
year_of_formationintegerThe year that the artist or band was formed.
countryvarchar(50)The country of origin or residence of the artist or band.
number_of_membersintegerThe number of members in the band.
album_releasedintegerThe total number of albums released by the artist or band.
labelvarchar(100)The record label or music company associated with the artist or band.

Example Input:

artist_idartist_namegenreconcert_revenueyear_of_formationcountrynumber_of_membersalbum_releasedlabel
103Taylor SwiftPop7000002004United States19Republic Records
104BTSK-Pop8000002013South Korea77Big Hit Music
105AdelePop6000002006United Kingdom13Columbia Records
109BlackpinkK-Pop4500002016South Korea45YG Entertainment
110Maroon 5Pop5500001994United States57Interscope Records

Difficulty

Medium

Input

Output