Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the database schema and the current state for the COMPANY relational database shown in Figure 1. Specify the following queries in SQL on

  

Consider the database schema and the current state for the COMPANY relational database shown in Figure 1. Specify the following queries in SQL on the COMPANY database schema given. (a) Retrieve the names of all employees along with the number of dependents they are related to. (b) Retrieve the names of all employees have no projects to work on. (c) Retrieve a list of projects with average number of hours greater than 15 hours per week. Results should present project number along with the average number of hours for each project. (d) Find a list of departments that are controlling two projects or more. The result should list department number along with the number of projects relevant. EMPLOYEE Address Frame Minit Lname B Smith 1234567891965-01-09 731 Fondren, Houston, TX John Franklin T Wong Alicia 333445555 1955-12-06 638 Voss, Houston, TX J Zelaya 999887777 1968-01-19 3321 Castle, Spring, TX Jennifer S Wallace 987654321 1941-06-20 291 Berry, Bellaire, TX Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX Joyce A English 453453453 1972-07-31 5631 Rice, Houston, TX F Ahmad V Jabbar 987987987 1969-03-29 980 Dallas, Houston, TX James E Borg 888665555 1937-11-10 450 Stone, Houston, TX M M M DEPARTMENT Dname Research Administration Headquarters WORKS ON Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445556 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 Dnumber 5 4 1 Pno Hours 1 32.5 2 7.5 3 40.0 1 20.0 2 20.0 2 10.0 10.0 10.0 10.0 3 10 20 30 10 10 Son 30 30 30.0 10.0 35.0 5.0 20.0 20 15.0 20 NULL Bdate Mgr son 333445555 987654321 888665555 DEPENDENT Esan Mgr start date 1988-05-22 1995-01-01 1981-06-19 PROJECT Prame 333445555 333445555 333445555 Joy 987654321 123456789 123456789 123456789 ProductX Product ProductZ Alice Theodore Sex Salary Super san Dno M 30000 333445555 M F F Dependent name Sex F Abner Michael Alice Elizabeth 40000 888665555 5 25000 987654321 4 43000 888665555 4 38000 333445555 5 25000 333445555 5 25000 987654321 4 55000 NULL 1 3 Computerization 10 Reorganization 20 Newbenefits 30 DEPT LOCATIONS Dnumber 1 4 5 Phumber 1 2 5 5 Dlocation Houston Stafford Belaire Bellaire Sugarland Houston Stafford Houston Stafford Sugarland Houston Plocation Dnum 5 5 5 4 1 4 Bdate Relationship 1906-04-05 Daughter 1983-10-25 Son M F M M 1988-01-04 Son F 1988-12-30 Daughter F 1967-05-05 Spouse 1958-05-03 Spouse 1942-02-28 Spouse Figure 1: A relational database schema for a COMPANY database

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Following are the SQL Queries a select eSsn as Employee NoCONCATeF... 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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant Navathe

7th Edition

0133970779, 978-0133970777

More Books

Students also viewed these Databases questions

Question

What are covert channels? Give an example of a covert channel.

Answered: 1 week ago