Consider the following schema:
Emp (Empcode, Name, Sex, Salary, Deptt)
A simple SQL query is executedasfollows:
SELECT Deptt FROM Emp
WHEREsex = ‘M’
GROUP by Dept
Having avg (Salary) > { select avg (Salary) from Emp}
The output will be
Create a FREE account and get: