easyFoodpanda · window
Rank grocery items by price within each category
A grocery listing table holds items with their category and price. The merchandising team wants to see, within each category, which item is the most expensive, second most expensive, and so on — with tied prices sharing the same rank.
Return category, item_name, price and price_rank, ordered by category then price_rank.
Schema
▸grocery_items
| item_id | INT |
| item_name | TEXT |
| category | TEXT |
| price | NUMERIC |
Example input
▸grocery_items
Stuck? Ask the coach for a nudge that won't give the answer away, or reveal the reference solution and a short walkthrough of why it works.