After groups have been established, SQL applies predicates in the ____ clause,…

2023

After groups have been established, SQL applies predicates in the ____ clause, allowing aggregate functions to be used.

  1. A.

    HAVING

  2. B.

    GROUP BY

  3. C.

    WITH

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 1304 students.

Show answer & explanation

Correct answer: A

After groups are formed using the GROUP BY clause, SQL uses the HAVING clause to apply conditions (predicates) on those groups. Unlike the WHERE clause, which filters rows before grouping, HAVING filters groups after aggregation. This allows the use of aggregate functions such as SUM, COUNT, AVG, etc., in the filtering condition. For example, you can use HAVING COUNT(*) > 5 to filter only those groups that have more than 5 rows. Therefore, the correct answer is HAVING.

Explore the full course: Up Lt Grade Assistant Teacher 2025