Bird
0
0

Which SQL clause is commonly used with SUM() to group results by categories?

easy📝 Conceptual Q2 of 15
SQL - Aggregate Functions
Which SQL clause is commonly used with SUM() to group results by categories?
AORDER BY
BHAVING
CWHERE
DGROUP BY
Step-by-Step Solution
Solution:
  1. Step 1: Identify grouping usage

    The GROUP BY clause groups rows to apply aggregate functions like SUM() per group.
  2. Step 2: Differentiate other clauses

    ORDER BY sorts results, WHERE filters rows before grouping, and HAVING filters groups after aggregation.
  3. Final Answer:

    GROUP BY -> Option D
  4. Quick Check:

    SUM() + GROUP BY = grouped sums [OK]
Quick Trick: Use GROUP BY to sum per category [OK]
Common Mistakes:
MISTAKES
  • Using WHERE instead of GROUP BY
  • Confusing HAVING with GROUP BY
  • Not grouping when summing categories

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes