Walmart's pricing team wants to flag premium items: products priced strictly above the average unit price of their own category. Return `item_name`, `category`, `unit_price` and `category_avg_price` (that category's average price, rounded to 2 decimals) for every such item. Order the results by `category` ascending, then `unit_price` descending, then `item_id` ascending.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.