Skip to main content
All Problems
easy0% acceptance

Total Revenue by Category

The product analytics team wants to see total revenue broken down by product category. Calculate the sum of total_amount from orders grouped by category. Use order_items and products to link orders to categories. Return the category name and total revenue, sorted by revenue descending.

Schema

🔑idINT
nameTEXT
descriptionTEXTNULL
postgresql

Run your query to see results

Press Ctrl + Enter to execute