Which of the following is true about the HAVING clause?

2023

Which of the following is true about the HAVING clause?

  1. A.

    Similar to the WHERE clause but is used for columns rather than groups

  2. B.

    Similar to WHERE clause but is used for rows rather than columns

  3. C.

    Similar to WHERE clause but is used for groups rather than rows

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 1656 students.

Show answer & explanation

Correct answer: C

The HAVING clause is used to filter groups after the GROUP BY clause has been applied. It operates on aggregate functions (like SUM, COUNT, AVG) and is applied to the result set of grouped rows. Unlike the WHERE clause, which filters rows before grouping, HAVING filters the groups themselves. This means HAVING is used when you need to apply conditions on aggregated data.

Explore the full course: Up Lt Grade Assistant Teacher 2025