I have to write a SQL statement to show a sum for similar types, I also need add another exclusion constraint from another table.
This is using Microsoft Access 2010. The problem reads: Write an SQL statement to show the sum of HoursWorked for each Type of OWNER but exclude services of employees who have an ExperienceLevel of Junior and exclude any Type with less than three members.
SELECT OWNER.Type, SUM(HoursWorked) AS Total_Work_Hours
FROM OWNER AS O, PROPERTY AS P, SERVICE AS S, EMPLOYEE AS E
WHERE O.OwnerID = P.OwnerID
AND P.Property= S.PropertyID
AND S.EmployeeID=E.EmployeeID
AND O.Type>3;