Question: Consider the Database in Appendix and write the following SQL queries. 1. For those departments which have average salary greater than $50,000, show the department

Consider the Database in Appendix and write the following SQL queries.

1. For those departments which have average salary greater than $50,000, show the department number (dno), the number of employees working for those departments and the average salary for the respective department.

2. Show all information about those employees who have dependents.

3. Show each employee's first name, last name and his/her manager's first name and last name.

4. For those employees who work for department number 5, show employee's first name, last name and his/her salary.

5. Show department name for those departments which are located in Stafford.

6. Show project numbers (PNO) and total number of hours worked on them.

Consider the Database in Appendix and write the following SQL queries. 1.

DEPENDANT ESSN 333445555 333445555 333445555 987654321 123456789 123456789 123456789 DEPENDENT NAME Alice Theodore Joy Abner Michael Alice Elizabeth SEX BDATE 4/5/1986 10/25/1983 5/3/1958 M 2/28/1942 1/4/1988 F. 2/12/1988 F 6/5/1967 RELATIONSHIP Daughter Son Spouse Spouse Son Daughter Spouse EMPLOYEE DNO 5 + FNAME MINIT LNAME SSN BDATE ADDRESS John B Smith 123456789 5/9/1965 731 Fondren, Houston, TX Franklin T Wong 333445555 8/12/1955 638 Voss, Houston, TX Alica Zelaya 999887777 7/19/1968 3321 Castle Spring, TX Jennifer S Wallace 987654321 6/20/1941 291 Berry Bellaire, TX Ramesh Narayan 666884444 9/15/1962 975 Fire Oak, Humble, TX Joyce A English 453453453 7/31/1972 5631 Rice, Houston, TX Ahmad Jabbar 987987987 3/29/1969 980 Dallas, Houston, TX James Borg 888665555 11/10/1937 450 Stone, Houston, TX SEX SALARY SUPERSSN M 30000 333445555 M 40000 888665555 F 25000 987654321 F 43000 888665555 M 38000 333445555 F. 25000 333445555 M 25000 987654321 M 55000 + + DEPARTMENT DEPT LOCATION DNAME DNUMBER MGRSSN MGRSTARTDATE Research 333445555 6/22/1988 Admin 987654321 1/1/1995 Headqters 888665555 6/19/1981 DNUMBER + DLOCATION Houston Stafford Bellaire Sugarland Houston 1 ch ch PROJECT WORKS ON PNAME ProductX productY Productz Computerization Reogranization Newbenefits PNUMBER PLOCATION DNUM Bellaire Sugarland Houston Stafford Houston Stafford ESSN PNO HOURS 1234567891 32.5 1234567892 7.5 666884444 3 453453453 453453453 333445555 333445555 333445555 333445555 999887777 30 999887777 10 987987987 987987987 30 987654321 30 987654321 888665555 20 + OOOO WNN- - + 20

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!