Skip to main contentSkip to solution

From the table 'Orders' below:

order_Idcustomer_Idorder_dateamount
11012024-03-012500
21022024-03-0112000
31012024-03-313000
41032024-04-014500
51022024-04-308000

Which query will retrieve the total amount from 'Orders' made by customer_Id = 101 in the month of March 2024.

Solution

✅ Correct Option: 3

Option 3 uses SUM(amount) to return a single total, reads from the Orders table with FROM, and filters rows to customer 101 in March 2024 using MONTH(order_date) = 3 AND YEAR(order_date) = 2024.

For customer 101 this picks orders 1 and 3, so the result is 2500+3000=55002500 + 3000 = \boxed{5500}.


Option 1: it has no FROM clause, so the query is invalid, even though the date range itself is correct.

Option 2: it returns individual amounts instead of a total, and the range ends at '2024-04-31', which is not a real date.

Option 4: the filter is correct, but it has no SUM, so it lists amounts (2500 and 3000) rather than the total.

Keyboard Shortcuts

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