Genpact Interview Question

Explain the use of GROUP BY and HAVING in SQL.