Development questions

What is the difference between WHERE and HAVING clauses in SOQL?

DevelopmentEasyInfosysWiproMindtree

WHERE filters individual rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and works with aggregate functions.

soql
SELECT AccountId, COUNT(Id) FROM Contact
WHERE Email != null
GROUP BY AccountId
HAVING COUNT(Id) > 5
soqlaggregategroup-by