Bird
0
0

Given the table Sales with rows:

medium📝 query result Q13 of 15
SQL - Aggregate Functions
Given the table Sales with rows:
Product | Quantity
Apple | 10
Banana | 5
Apple | 15

What is the result of the query:
SELECT SUM(Quantity) FROM Sales WHERE Product = 'Apple';
A10
B15
C25
D30
Step-by-Step Solution
Solution:
  1. Step 1: Filter rows where Product = 'Apple'

    Rows matching: Apple with Quantity 10 and Apple with Quantity 15.
  2. Step 2: Sum the Quantity values for these rows

    10 + 15 = 25.
  3. Final Answer:

    25 -> Option C
  4. Quick Check:

    10 + 15 = 25 [OK]
Quick Trick: Sum only filtered rows matching condition [OK]
Common Mistakes:
MISTAKES
  • Summing all rows ignoring WHERE clause
  • Adding only one matching row
  • Confusing Quantity values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes