Using a CTE, compute each album's track count, then return only albums whose track count exceeds the average track count across all albums.
Return AlbumId, Title, and TrackCount, ordered by TrackCount descending (ties broken by AlbumId ascending).
| Column | Type |
|---|---|
| AlbumId | INTEGER (Primary Key) |
| Title | TEXT |
| Column | Type |
|---|---|
| TrackId | INTEGER (Primary Key) |
| AlbumId | INTEGER (Foreign Key -> Album.AlbumId) |
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.