Sales Analysis
Beginner
10 XP
You can try this as a guest. Sign in to hand it in and keep your progress.
Sign in
Find the top products by total revenue using SQL.
The data
An orders table with product_name, quantity, and unit_price.
Tables
CREATE TABLE orders (id INTEGER PRIMARY KEY, product_name TEXT, quantity INTEGER, unit_price REAL, order_date TEXT);
To pass
- SUM
- GROUP BY
- ORDER BY
- calculated columns
Need a hint?
- Revenue = quantity * unit_price.
- Use SUM() with GROUP BY to aggregate per product.
- ORDER BY revenue DESC puts the highest first.