The brief
Priya is prepping the quarterly review. She wants the single best-selling product in each category — ranked by revenue, not just price — so she can feature the winners. "Revenue" means amount × qty, because selling four cheap cables can beat one pricey lamp.
This is a four-move pipeline, and you've drilled every move:
1. derive amount * qty AS revenue (Module 13 — expressions) 2. rank row_number() OVER (PARTITION BY category ORDER BY revenue DESC) (Module 7 — windows) 3. filter keep rn = 1 (Module 2 — filtering) 4. select category, product, revenue (Module 1 — columns)
