Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a separate .sql file (do not modify company.sql), write a script that contains the following eight SQL queries (in this order): 4. For each

In a separate .sql file (do not modify company.sql), write a script that contains the following eight SQL queries (in this order):

4. For each project, display the project location and project number and the total hours spent on that project. (List the projects from the one with the largest total hours to the smallest.) 5. List the IDs of all employees who are assigned to exactly two projects. (Hint: Start by counting how many projects each employee is assigned to.) 6. For each department, display the department number, the total number of employees in the department and the average salary of all employees working in that department. Order the output from the department with the fewest employees to the one with the most. 7. Give an alphabetical list of only the last names of all female employees who have at least one son. 8. List the names of all male employees who work at least 20 hours on the ProductX project

image text in transcribedimage text in transcribed

1. Employee FNAME LNAME ID SALARY DNO SUPERVISO Susan John Jenniter Amelia Salman Jim Joanna Crystal Ramesh Joan Steve Schmidt Washington Wallace Zelaya Ahmed Wong Ramirez Smith Narayanan Jones Aoki 123456789 F 888665555 M 987654321 F 997303033 F 987987987 M 333446655 M 707011333F 11222233 F 689689689 M 543212345 F 246824688 M 90000 80000 49000 45000 56000 55000 49000 35000 38000 29000 32000 1 123456789 3 888665555 3 888665555 2 123456789 2 123456789 2 888665555 4 997303033 4 997303033 4 987987987 4 987987987 2. Department DNAME DNUMBER Administration Research Marketing Advertising 1 2 4 3. Project PNAME PNUMBER PLOCATION Automation Training Benefits ProductX ProductY Productz Publicity 11 Houston 22 Denver 33 Denver 44 New York 55 Chicago 66 Chicago 77 New York

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions