Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. Both WHERE and HAVING clauses are used to specify conditions.
Reason. The WHERE and HAVING clauses are interchangeable.
SQL Queries
2 Likes
Answer
(b)
Both Assertion and Reason are true but Reason is not the correct explanation of Assertion.
Explanation
Both WHERE
and HAVING
clauses are used to specify conditions in a SELECT
query, they operate at different levels. The WHERE
clause filters rows based on conditions applied to individual rows before grouping, while the HAVING
clause filters groups based on conditions applied to the result of aggregation functions after grouping. Hence, they are not interchangeable.
Answered By
1 Like