Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EMPLOYEEWrite SQL queries to answer the following questions: Retrieve the name and manager's SSN of each department. Retrieve the names of employees whose supervisor's SSN

EMPLOYEEWrite SQL queries to answer the following questions:
Retrieve the name and manager's SSN of each department.
Retrieve the names of employees whose supervisor's SSN is 333445555;
Retrieve the last name and address of female employees who work for department 5.
Retrieve the average salary, minimum salary of employees in department 5.
For each employee who have dependents, list his/her SSN and the number of
dependents he/she has.
Retrieve the first names and last names of employees whose last names start with 'J'.
Retrieve the project number of each project along with the number of employees
working on it.
For each employee with more than one dependent, list his/her name and the total
number of dependents he/she has.
Retrieve the number of distinct employees that have dependents.
Retrieve the names of employees who work on the project with pno=30.
(extra credit) For each department with at least two locations, retrieve the department
number along with its locations.
DEPARTMENT
DEPT_LOCATIONSWORKS_ON
\table[[Essn,Pno,Hours],[123456789,1,32.5],[123456789,2,7.5],[666884444,3,40.0],[453453453,1,20.0],[453453453,2,20.0],[333445555,2,10.0],[333445555,3,10.0],[333445555,10,10.0],[333445555,20,10.0],[999887777,30,30.0],[999887777,10,10.0],[987987987,10,35.0],[987987987,30,5.0],[987654321,30,20.0],[987654321,20,15.0],[888665555,20,NULL]]
PROJECT
\table[[Pname,Pnumber,Plocation,Dnum],[ProductX,1,Bellaire,5],[ProductY,2,Sugarland,5],[ProductZ,3,Houston,5],[Computerization,10,Stafford,4],[Reorganization,20,Houston,1],[Newbenefits,30,Stafford,4]]
DEPENDENT
\table[[Essn,Dependent_name,Sex,Bdate,Relationship],[333445555,Alice,F,1986-04-05,Daughter],[333445555,Theodore,M,1983-10-25,Son],[333445555,Joy,F,1958-05-03,Spouse],[987654321,Abner,M,1942-02-28,Spouse],[123456789,Michael,M,1988-01-04,Son],[123456789,Alice,F,1988-12-30,Daughter],[123456789,Elizabeth,F,1967-05-05,Spouse]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago