The pricing team wants to identify premium-priced Track. Find all tracks that are priced above the average track price in the catalog.
Write a SQL query that finds tracks with a UnitPrice greater than the average UnitPrice across all Track.
| Column | Type |
|---|---|
| TrackId | INTEGER (Primary Key) |
| Name | TEXT |
| AlbumId | INTEGER (Foreign Key → Album.AlbumId) |
| MediaTypeId | INTEGER (Foreign Key) |
| GenreId | INTEGER (Foreign Key → Genre.GenreId) |
| Composer | TEXT |
| Milliseconds | INTEGER |
| Bytes | INTEGER |
| UnitPrice | NUMERIC(10,2) |
A subquery is a query nested inside another query. You can use it to calculate a value (like average) and then compare against it.
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.