5. Assume that based on your suggestions and their additional requirements, Gard
ID: 3853641 • Letter: 5
Question
5. Assume that based on your suggestions and their additional requirements, Garden Glory designs a trail database saved as Garden_Glory.accdb in MS Access 2013. Query the trail database using SQL statements and answer the following questions. For each SQL statement you write, show the results based on your data (you could press the "PrtSc - Print Screen" key to capture the results image) .
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.
Explanation / Answer
1.SELECT DISTINCT E.LName, E.FName FROM EMPLOYEE as E JOIN PROPERTYSERVICE as PS ON E.EmployeeID = PS.EmployeeID JOIN OWNEDPROPERTY as OP ON PS.PropertyID = OP.PropertyID JOIN OWNER as O ON OP.OwnerID = O. OwnerID WHERE O.OwnerType = 'Corporation';
or
SELECT LName, FName FROM EMPLOYEE WHERE Employee ID IN (SELECT EmployeeID FROM PROPERTYSERVICE WHERE PropertyID IN (SELECT PropertyID FROM OWNEDPROPERTY WHERE OwnerID IN (SELECT OwnerID FROM OWNER WHERE OwnerType = 'Corporation')));
2.SELECT LName, FName, SUM (Hours Worked) AS Total Hours Worked FROM EMPLOYEE JOIN PROPERTYSERVICE ON EMPLOYEE. EmployeeID = PROPERTYSERVICE.EmployeeID GROUP BY LName, FName ORDER BY LName, FName;
3.Select experiancelevel, sum(hours) from employee group by experiancelevel sort by experiancelevel;
4.select sum(hours worked) from propertyservice inner join propertyserviceemployeeID=employee.employeeID where experiencelevel! ='junior;
where
Lname=Last Name
Fname=First Name
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.