GROUP BY clause, allowing you to filter groups based on a specified condition. Unlike the WHERE clause, which is used to filter rows before they are grouped, the HAVING clause is applied to each group of grouped data.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.


On a relation named Loan of a bank: 
On a relation named Loan of a bank: 
The following SQL query is executed:
SELECT L1.loannumber FROM Loan L1 WHERE L1.amount \(>\) (SELECT MAX(L2.amount) FROM Loan L2 WHERE L2.branchname = 'SR Nagar');
Rearrange the following parts to form a meaningful and grammatically correct sentence:
P. a healthy diet and regular exercise
Q. are important habits
R. that help maintain good physical and mental health
S. especially in today's busy world