Bird
0
0

Choose the correct way to filter grouped results using the HAVING clause:

easy📝 Syntax Q3 of 15
SQL - GROUP BY and HAVING

Choose the correct way to filter grouped results using the HAVING clause:

SELECT city, COUNT(*) FROM customers GROUP BY city _______ COUNT(*) > 10;
AFILTER
BWHERE
CHAVING
DGROUP BY
Step-by-Step Solution
Solution:
  1. Step 1: Understand filtering groups

    The WHERE clause filters rows before grouping, so it cannot filter aggregated groups.
  2. Step 2: Use HAVING for group filters

    The HAVING clause filters groups after aggregation, so it is the correct clause to use here.
  3. Final Answer:

    HAVING -> Option C
  4. Quick Check:

    Filtering groups requires HAVING clause [OK]
Quick Trick: Use HAVING to filter groups after aggregation [OK]
Common Mistakes:
MISTAKES
  • Using WHERE instead of HAVING for group filters
  • Placing HAVING before GROUP BY
  • Using FILTER keyword which is invalid here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes