CodeMIRAI
0 XP

Order totals

Hard +80 XP Solved

For each order, return the order_id and its total value (the sum of quantity × price over its items), rounded to 2 decimal places. Show only orders worth more than 200, largest first.

Input
(none)
Expected output
102 | 558
105 | 349
111 | 318.9
108 | 288.99
104 | 248
Show a hint

Join order_items to products for the price, GROUP BY order_id, and use HAVING (not WHERE) to filter on the sum.

Show a solution
SQL
Loading the editor…
Run the tests to check your solution.