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

Hello, I am working on SQL codes but I just can\'t figure out these remaining qu

ID: 3821638 • Letter: H

Question

Hello, I am working on SQL codes but I just can't figure out these remaining questions. Would anyone be able to help?

5.4) Write an SQL statement to list the Name of employees who have worked on a property in New York .

5.5) Write an SQL statement to list the names of employees who have worked on a property owned by a Corporation .

5.6) Write an SQL statement to show the name and sum of HoursWorked for each employee.

5.7) Write an SQL statement to show the sum of HoursWorked for each ExperienceLevel of EMPLOYEE. Sort the results by ExperienceLevel in descending order.

5.8) 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.

EMPLOYEE EmployeeID LastName FirstName CellPhone ExperienceLevel 1 Murray Dale R. Murray Dale 206-254-3456 Senior 2 Murphy Jerry 585-545-8765 Master 3 Fontaine Joan 206-254-4567 Junior 4 Evanston John 206-254-2345 Junior 5 Smith Sam 206-254-1234 Master

Explanation / Answer

SELECT LastName, FirstName

FROM EMPLOYEE

WHERE EmployeeID

IN (SELECT EmployeeID FROM SERVICE WHERE EmployeeID IN (SELECT EmployeeID FROM PROPERTY WHERE City = 'Newyork'));

2)SELECT LastName, FirstName

FROM EMPLOYEE

WHERE EmployeeID

IN (SELECT EmployeeID FROM PROPERTY_SERVICE WHERE PropertyID

IN (SELECT PropertyID FROM OWNED_PROPERTY WHERE OwnerID IN (SELECT OwnerID FROM OWNER WHERE OwnerType = 'Corporation')));

3)SELECT LastName, FirstName, SUM(HoursWorked)

AS TotalHoursWorked FROM EMPLOYEE JOIN PROPERTY_SERVICE

ON EMPLOYEE.EmployeeID = PROPERTY_SERVICE.EmployeeID

GROUP BY LastName, FirstName ORDER BY LastName, FirstName;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote