One price, many ranks

Our catalog lives on just two prices — 1.29 and 0.99 — so ties are everywhere. For every track show title, unit_price, and two more columns: price_rank with RANK() and price_dense with DENSE_RANK(), both over unit_price from highest to lowest. Watch how the two differ where the price repeats.

Tables in this exercise
tracks
id title album_id genre_id duration_sec unit_price

Back to the chapter