A podcast is featuring "epic length" songs and wants to know the longest tracks in the database. Track duration is stored in milliseconds.
Write a SQL query to find the 10 longest tracks by duration. Return the track name and duration in milliseconds, sorted from longest to shortest.
| 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) |
Duration is stored in milliseconds. For reference: 1 minute = 60,000 milliseconds.
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.