Genre Popularity (chinook database)
Medium
2
57.1% Acceptance
Your task is to rank the different genres available in the chinook database by the number of tracks that belong to each genre. Use SQLite syntax.
Tables Involved:
Genre
Track
SQL Concepts Tested:
- Joins
- Aggregation (COUNT)
- Ordering
Final Columns to Display:
genres.Name
TrackCount
(This will be an alias for the aggregated column)- Sort the results by the number of tracks (
TrackCount
) in descending order. The column must be namedTrackCount
.
Guidelines:
Create a SQL query that accomplishes the above objective. Make sure to join the Genre
and Track
tables, and to group the results by GenreId
. Order the results by TrackCount DESC
. Use double quotes for table and column names, such as "Genre"
and "Name"
.