Project 29: Order Totals Calculator
SQL Architect
Query Task
Objective
Review day: aggregate functions inside GROUP BY to compute a real business number — each order's total, from its individual line items.
You're given an order_items table with columns id, order_id, product_name, quantity, and price.
Task: return order_id and the sum of quantity * price (as order_total), grouped by order_id.
query.sql
SELECT order_id, SUM(quantity * price) AS order_total FROM order_items GROUP BY order_id;
* Hint: Correct characters turn green, incorrect ones turn red.
Query Results
🗄️
Execute your query to see results