Question: Write SQL queries for the exercise c, d, e, f, g, h, i, and j base on the figure I uploaded. (c) Find the names
Write SQL queries for the exercise c, d, e, f, g, h, i, and j base on the figure I uploaded.
(c) Find the names of employees that are directly supervised by 'Franklin Wong'.
(d) For each project, list the project name and the total hours per week (by all employees) spent on that project.
(e) Retrieve the names of employees who work on every project.
(f) Retrieve the names of employees who do not work on any project.
(g) For each department, retrieve the department name, and the average salary of employees working in that department.
(h) Retrieve the average salary of all female employees.
(i) Find the names and addresses of employees who work on at least one project located in Houston but whose department has no location in Houston.

Figure 5.6 One possible database state for the COMPANY relational database schema. EMPLOYEE Sex Salary Super ssn Fname Minit Lname Bdate Address B Smith 123456789 1965-01-09 731 Fondren, Houston, TX M 30000 3334455555 FranklinT Wong 333445555 1955-12-08 638 Voss, Houston, TX M 40000 888665555 5 Alicia JenniferS Wallace 9876543211941-06-20 291 Berry, Bellaire, TXF 43000 888665555 4 Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M 38000 333445555 5 Joyce A English 453453453 1972-07-31 5631 Rice, Houston, TX F 25000 333445555 5 AhmadVJabbar 987987987 1969-03-29 980 Dallas, Houston, TX M 25000 987654321 4 James EBorg 888665555 1937-11-10 450 Stone, Houston, TX M 55000 NULL JZelaya 999887777 1968-01-19 3321 Castle, Spring, TX F25000 987654321 4 DEPARTMENT DEPT LOCATIONS Dnumber Dnumber Dname Research Administration Headquarters Mgr ssn 333445555 987654321 888665555 Mgr start_date 1988-05-22 1995-01-01 1981-06-19 Dlocation Houston Stafford Bellaire Sugarland Houston 4 WORKS ON PROJECT Pname Pnumber Plocation Dnum ssn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 32.5 ProductX ProductY ProductZ Computerization10Stafford Reorganization Newbenefits Bellaire 5 Sugarland 5 3 40.0 3 Houston 4 Houston Stafford 4 DEPENDENT Dependent_name Sex Relationship ssn 30.0 333445555 333445555 Theodore 333445555 Joy 987654321 123456789 123456789 123456789 F 1986-04-05 Daughter M 1983-10-25 Son F 1958-05-03 Spouse M 1942-02-28 Spouse M 1988-01-04 Son F 1988-12-30 Daughter F 1967-05-05 Spouse 35.0 Abner Michael ice Elizabeth 20.0 20 NULL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
