Genre-local rankings
A global ranking is fine, but shoppers compare inside a genre. Rank every track within its own genre_id, by duration_sec from longest to shortest. Equal durations share a rank, RANK() style. Still 49 rows — one per track, each with its rank inside its genre.
Tables in this exercise
tracks
id title album_id genre_id duration_sec unit_price