Question:

The HAVING clause is used to filter groups based on which function results?

Show Hint

Remember:
- WHERE filters raw data rows (no aggregate functions allowed).
- HAVING filters summarized group data (aggregate functions allowed).
Updated On: Jun 11, 2026
  • Mathematical
  • Aggregate
  • Window
  • Recursive
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation


Step 1: Understanding the Question:

The question asks to identify the type of SQL functions whose computed output values are used by the HAVING clause to perform group filtering.

Step 2: Understanding Groups and Filtering in SQL:

- When we run a GROUP BY query, individual rows are compressed into logical categories.
- We cannot filter these categories using raw column values because each category contains multiple rows.
- Instead, we must summarize these rows using Aggregate Functions (e.g., SUM(), AVG(), COUNT(), MIN(), MAX()) which compute a single value for each group.

Step 3: Detailed Explanation:

- The HAVING clause acts specifically as a filter for groups formed by the GROUP BY clause.
- It evaluates conditions based on aggregate calculations (e.g., HAVING COUNT(CustomerID) > 5 or {HAVING AVG(Salary) < 40000}).
- Mathematical functions (like ABS() or ROUND()) operate on individual numbers, not group sets.
- Window functions compute values across rows but do not compress groups, and recursive functions are used for hierarchical queries.
- Therefore, the HAVING clause is explicitly designed to filter groups based on Aggregate function results.

Step 4: Final Answer:

The HAVING clause evaluates aggregate function results to perform group-level filtering.
Hence, option (B) is the correct choice.
Was this answer helpful?
0
0