Question:

Which SQL clause is used to apply conditions on groups?

Show Hint

WHERE works on rows. HAVING works on groups created using GROUP BY.
Updated On: Jun 25, 2026
  • WHERE
  • WITH
  • SELECT
  • HAVING
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept: SQL provides different clauses for filtering rows and groups.

Step 1:
Understand WHERE clause.
WHERE filters individual rows before grouping. Example: \[ \texttt{SELECT * FROM Employee WHERE Salary > 50000;} \]

Step 2:
Understand HAVING clause.
HAVING filters groups after GROUP BY is applied. Example: \[ \texttt{SELECT Dept, COUNT(*)} \] \[ \texttt{FROM Employee} \] \[ \texttt{GROUP BY Dept} \] \[ \texttt{HAVING COUNT(*) > 5;} \]

Step 3:
Choose the answer.
Since the question asks for conditions on groups, \[ \boxed{\text{HAVING}} \] is the correct clause.
Was this answer helpful?
0
0