Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

OWNER ( OwnerID, OwnerName, OwnerEmail, OwnerType ) PROPERTY ( PropertyID, Prope

ID: 3680693 • Letter: O

Question

OWNER ( OwnerID, OwnerName, OwnerEmail, OwnerType )
PROPERTY ( PropertyID, PropertyName, Street, City, State, Zip,OwnerID )
EMPLOYEE ( EmployeeID, LastName, FirstName, CellPhone, ExperienceLevel )
SERVICE ( PropertyID, EmployeeID, ServiceDate, HoursWorked )

Write an SQL statement to show the sum of hours worked for each ExperienceLevel of EMPLOYEE. Sort the results by ExperienceLevel, in descending order. The result should look like the following:

ExperienceLevel SumOfHoursWorked Senior 9 Master 19 Junior 5

Explanation / Answer

Select EmployeeID, sum(HoursWorked) as SumOfHoursWorked from SERVICE Group By EmployeeID as Total_Work_Hour;
Select ExperienceLevel , SumOfHoursWorked from EMPLOYEE, Total_Work_Hour where Total_Work_Hour.EmployeeID=EMPLOYEE.EmployeeID Order By ExperienceLevel DESC;