Amazon marketplace analysts monitor merchandise value across retail categories. Write a query to compute the total sales revenue generated in each product category. Include categories that have zero sales, reporting their total revenue as 0. Return `category_name` and `total_revenue` (calculated as quantity multiplied by unit_price). Sort results by `total_revenue DESC`, then by `category_name ASC` in case of ties.
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.