Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the following SQL query: List the fname, lname for employees who have more than the average number of dependents. Compute the average number of
Write the following SQL query: List the fname, lname for employees who have more than the average number of dependents. Compute the average number of dependents over ALL employees, not just those with dependents.
The database is as follows:
EMPLOYEE | FNAME | MINIT |LNAME | SSN SEX SALARY | SUPERSSN DNO Smith 123456789 1965-01-09 333445555 638 Voss, Houston, TX 987654321 Wallace 9876543211941-06-20 975 Fire Oak, Humble, TX 5631 Rice, Houston, TX 980 Dallas, Houston, TX 450 Stone, Houston, TX Narayan 453453453 1972-07-31 987987987 1969-03-29 333445555 Jabbar 987654321 Borg DEPT LOCATIONS DNAME Research DNUMBER MGRSSN MGRSTARTDATE 1988-05-22 995-01-01 1981-06-19 DEPARTMENT Headquarters WORKS ON ESSNPNO HOURS 123456789 53453453 PROJECT PNAME PNUMBER PLOCATION DNUM 987987987 987987987 ESSN I DEPENDENT NAME SEX BDATE RELATIONSHIP Theodore 1983-10-25 1958-05-03 1942-02-28 1988-01-04 SPOUSE EMPLOYEE | FNAME | MINIT |LNAME | SSN SEX SALARY | SUPERSSN DNO Smith 123456789 1965-01-09 333445555 638 Voss, Houston, TX 987654321 Wallace 9876543211941-06-20 975 Fire Oak, Humble, TX 5631 Rice, Houston, TX 980 Dallas, Houston, TX 450 Stone, Houston, TX Narayan 453453453 1972-07-31 987987987 1969-03-29 333445555 Jabbar 987654321 Borg DEPT LOCATIONS DNAME Research DNUMBER MGRSSN MGRSTARTDATE 1988-05-22 995-01-01 1981-06-19 DEPARTMENT Headquarters WORKS ON ESSNPNO HOURS 123456789 53453453 PROJECT PNAME PNUMBER PLOCATION DNUM 987987987 987987987 ESSN I DEPENDENT NAME SEX BDATE RELATIONSHIP Theodore 1983-10-25 1958-05-03 1942-02-28 1988-01-04 SPOUSEStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started