Skip to content

SQL challenge 7 of 25

Total of each order

  • Medium
  • GROUP BY
  • SUM
  • expressions
  • Solved

Your task

Work out the total of every order: the sum of quantity × unit price of its items. Return the order id and the total, with the biggest order first.

Return: order id, total · Database: Online shop · Row order is checked

Correct! Your result matches.

Not quite yet

Your result

Expected result

Loading…

Preparing for an interview? Read the SQL interview questions, or write any query in the SQL playground.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.