Retrieve the names of all employees whose supervisor’s SSN is 888665555. • For e
ID: 3711974 • Letter: R
Question
Retrieve the names of all employees whose supervisor’s SSN is 888665555.
• For each department manager, retrieve his/her name along with the names of projects that he/she is working on.
• Retrieve the manager’s first and last name of the each department that locates in ‘Houston’.
• Find the SSNs of department managers who don’t have dependents. • (Extra credit)Retrieve the first and last name of each department manager and the first and last name of his/her immediate supervisor
Figure 3 One possible database state for the COMPANY relational database schema EMPLOYEE Bdate B Smith 123456789 1965-01-09 231 Fondren, Houston, TX M 30000 John Frankin T Wong 333445555 1955-12-08 Alicia rS Wallace 987654321 1941 06-20 291 Benry BelaeX43000 890665555 455555 638 Voss. Houston, TX M 40000 888665555 JZelaya 999887777 1968-01-19 3321 Castle TXF25000 RKNorayan 000884444 1002091e HmT M 38000 20445598 loyceA Engish 453453453 1972-0731 5631 Rice Hoason. TXF 25000 AhmadV Jabbar982987987 1969-03-29 980 Dutas Houstion TXM 25000 9876543 amo E IBorg 888665555 1932-11-10, 450st nMouton. TX M 55000 NULL 445555E DE PARTMENT DEPT LOCATIONS Drame Dumber 338455 9826543Explanation / Answer
Answer is as follows :
According to Chegg Guidelines, we are allowed to solve first three parts so please repost other two.
a) Retrieve the names of all employees whose supervisor’s SSN is 888665555
SELECT Fname,Lname FROM Employee WHERE Super_SSN = 888665555;
b) For each department manager, retrieve his/her name along with the names of projects that he/she is working on
SELECT Employee.Fname,Employee.Lname,Project.Pname FROM Employee JOIN Department ON Employee.Ssn = Department.Mgr_Ssn JOIN Works_On ON Department.Mgr_Ssn = Works_On.Essn JOIN Project ON Works_On.Pno = Project.Pnumber ;
c) Retrieve the manager’s first and last name of the each department that locates in ‘Houston’.
SELECT Employee.Fname,Employee.Lname FROM Department JOIN Employee ON Department.Mgr_Ssn = Employee.Ssn JOIN Dept_Location ON Department.Dnumber = Dept_Location.Dnumber WHERE DLocation = 'Hudson' ;
if there is any query or want other parts please ask in comments...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.