GROUP BY clause, enabling the filtering of these aggregated sets based on specific criteria. Contrasting with the WHERE clause, which filters individual records prior to aggregation, the HAVING clause operates on the entire groups created by GROUP BY.

On a relation named Loan of a bank: 