Bird
0
0

What does the HAVING clause do in an SQL query?

easy📝 Conceptual Q1 of 15
SQL - GROUP BY and HAVING

What does the HAVING clause do in an SQL query?

AFilters groups after aggregation
BFilters rows before aggregation
CSorts the result set
DJoins two tables
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of HAVING

    The HAVING clause is used to filter groups created by GROUP BY after aggregation functions are applied.
  2. Step 2: Differentiate HAVING from WHERE

    WHERE filters rows before grouping, HAVING filters groups after aggregation.
  3. Final Answer:

    Filters groups after aggregation -> Option A
  4. Quick Check:

    HAVING filters groups = D [OK]
Quick Trick: HAVING filters groups, WHERE filters rows before grouping [OK]
Common Mistakes:
MISTAKES
  • Confusing HAVING with WHERE clause
  • Thinking HAVING filters rows before aggregation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes