Skip to main contentSkip to solution

Table-ProductsSale:

IDProductPrice
101A100
102B55
103C55
104D65
105E35

Which query should be used to retrieve the total price from the table for products which have price greater than 55?

Solution

✅ Correct Option: 1

SUM(Price) adds up the values in the Price column, and WHERE Price > 55 filters the rows before the sum is taken. Only products A (100) and D (65) have a price greater than 55, so the query returns 100+65=165100 + 65 = \boxed{165}.


Option 2: SUM(Product) is wrong because Product holds text, not numbers. HAVING also needs GROUP BY and is meant for conditions on groups, not for filtering rows.

Option 3: GROUP BY only groups rows and does not add them up, so it gives no total.

Option 4: DISTINCT only removes duplicates, and Price >= 55 would also include B and C. It returns product names, not a total.

Keyboard Shortcuts

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