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:
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;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.