Skip to main contentSkip to solution

From the following table "orders"

order_Idcustomeramount
c001Riya500
c002Rohit300
c003Ravi400

Which query will output the following result?

Total Amount

900

Solution

✅ Correct Option: 2

WHERE amount > 300 keeps only the rows with amounts 500 (Riya) and 400 (Ravi). SUM(amount) then adds them: 500+400=900500 + 400 = \boxed{900}


Option 1: MAX returns the largest value, 500, not the total.

Option 3: ORDER BY only sorts the rows and does not filter them, so SUM adds all three amounts and gives 1200.

Option 4: no amount is below 300 (Rohit's is exactly 300), so no rows match and SUM returns NULL.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question