In SQL, what is the purpose of the HAVING clause?
Correct Answer: a. To specify conditions for groups created by the GROUP BY clause.
The HAVING clause in SQL is used to filter the results of groups created by the GROUP BY clause. Unlike the WHERE clause, which filters individual rows before grouping, HAVING filters group-level data after aggregation has occurred.
It is commonly used with aggregate functions like COUNT, SUM, AVG, etc., to apply conditions to grouped results. This makes it essential for analyzing grouped records in SQL queries.
Why the Other Choices Are Incorrect:
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams