Specify the SQL queries on the COMPANY relational database schema shown below:
1) List the names of all employees who have a dependent with the same first name as themselves.
2) For each project, list the project name and the total hours per week (by all employees) spent on that project.
3) Retrieve the names of all employees who work on every project.
4) Retrieve the names of all employees who do not work on any project.
5) For each department, retrieve the department name and the average salary of all employees working in that department.
6) List the last names of all department managers who have no dependents.
Figure 5.6:
Dno 5 5 5 4
Houston Stafford wnua 5 5 6
Relationship Smn asnods asnods 333445555 987654321 199999888 333445555 333445555 987654321
DEPT_LOCATIONS Plocation Bellaire Sugarland 55000NULL Stafford 1983-10-25 1958-05-03 1988-01-04Son 25000 43000 25000 25000 4 5 5
Bdate 1986-04-05 1942-02-28 1988-12-30 38000 1967-05-05
Salary 30000 40000 xex M E WI F W W
Pnumber 1 2 3 10 2
Sex W F M W F
731 FondrenHoustonTXM 975 Fire Oak,Humble,TX
Pname ProductX ProductY ProductZ Computerization Reorganization
638 Voss, Houston,TX 331Castle,Spring.TX 291 Berry,Bellaire,TX 5631 Rice,Houston,TX 980 Dallas,Houston,TX 450 Stone,Houston,TX
PROJECT Newbenefits Address
Dependent_name Mgr_start_date
1988-05-22 1995-01-01 1981-06-19 Alice Theodore Lor Abner Michael Alice Elizabeth
Bdate 1965-01-09 1955-12-08 1968-01-19 1941-06-20 1962-09-15 1972-07-31 1969-03-29 1937-11-10
DEPENDENT Essn 333445555 333445555 333445555 987654321 123456789 123456789 123456789
Mgr_ssn 333445555 987654321 888665555
Ssn 123456789 333445555 999887777 987654321 666884444 453453453 987987987 888665555
Hours 32.5 7.5 40.0 20.0 20.0 10.0 10.0 10.0 10.0 30.0 10.0 35.0 5.0 20.0 15.0 NULL
Dnumber 5 4
Lname Smith Wong Zelaya Wallace Narayan English Jabbar Borg
Pno 1 2 3 1 2 2 10 20 30 10 10 30 30 20 20
Minit 1 S ? A > E
DEPARTMENT Dname Research Administration Headquarters
Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555
EMPLOYEE Fname Franklin Alicia Jennifer Ramesh Joyce Ahmad James WORKS_ON John