Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7-1 [6 points] Specify the following additional queries on the database in Figure 5.5 in SQL Show the query results if applied to the database
7-1 [6 points] Specify the following additional queries on the database in Figure 5.5 in SQL Show the query results if applied to the database state in Figure 5.6 (a) For each department whose average employee salary is more than S30,000, retrieve the department name and the number of employees working for that department. (b) Retrieve the number of male employees in each department making more than $30,000? 7-2. 9 points] In SQL, specify the following queries on the database specified in Figure 5.5 using the concept of nested queries and the concepts described in this chapter (a) Retrieve the names of all employees who work in the department that has the employee with the highest salary among all employees. (b) Retrieve the names of all employees whose supervisor's supervisor has '888665555' for Ssn. (c) Retrieve the names of employees who make at least $10,000 more than the employee who is paid the least in the company Figure 5.8 One possible database state for the COMPANY relational database schema EMPLOYEE Fname Mint Lname Bdate Bdate Address Sex ssn Dno BSmih123456789 1965-01-09 731 Fondren, Houston, TX M 30000 333445555 5 33445555 1055 12-08 638 Voss, Houaton, TX M 40000 Franklin T Alicia Jennider llace 987654321 1041 0620 201 Berry, Bellaire, TX 43000 Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak Humble TX M 38000 333445555 oce AEgish 453453453 1972-07-31 5631 Rce Houston TX 000 333445555 Ahmad VJabbr 98987196903-29 980 Dallas, Houston, TXM 25000 James E Barg888665555 1937-11-10 450 Stone, Houston, TXM $5000 DEPARTMENT 968-01-19 3321 Case Dname Dnumber start DEPT LOCATIONS Plocation Dnum DEPT LOCATIONS Dname start date 1988-05 22 WORKS ON 33445555 Hours Figure 545 Schema dagram for the COMPANY relational database schema Bellaire DEPENDENT t name Bdate Pnumber Plocation Dnum 23456789 12345678 340o 2 20.0 Sex Bdate 333445555 Aice 195805-03Spouse 33445545 Jo 98764321 23456780 Michael 123456789 Alice M 1942-02-28Spouse 30 20.0 F 1988-12-30 F1967-06-05 Spouse 888665555 20
Step 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