SQL Group Filtering: SQL provides different clauses for filtering data at different stages of query execution.
Key Differences:
Example Demonstration:
SELECT department, AVG(salary) FROM employees GROUP BY department HAVING AVG(salary) > 50000; ← Filters after grouping
Why HAVING is correct:
The correct answer is (2) having, as it's the only clause that applies conditions after groups are formed.
List-I (Words) | List-II (Definitions) |
(A) Theocracy | (I) One who keeps drugs for sale and puts up prescriptions |
(B) Megalomania | (II) One who collects and studies objects or artistic works from the distant past |
(C) Apothecary | (III) A government by divine guidance or religious leaders |
(D) Antiquarian | (IV) A morbid delusion of one’s power, importance or godliness |