Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use the following database to answer all parts of this question ( show only the Outputs ). Table: EMP Primary Key: E_NO E_NO E_NAME E_RATE
Use the following database to answer all parts of this question (show only the Outputs).
Table: EMP Primary Key: E_NO
Table: PART Primary Key: P_NO
Table: PROJECT Primary Key: PR_NO
Table: SUPPLIER Primary Key: S_NO
Table: SUPPLY
Primary Key: P_NO + PR_NO + S_NO
Foreign Key: P_NO references PART Foreign Key: PR_NO references PROJECT Foreign Key: S_NO references SUPPLIER
Table: WORK
Primary Key: ENO + PRNO
Foreign Key: E_NO references EMP Foreign Key: PRNO references PROJECT
Questions:
Table: EMP Primary Key: E_NO
E_NO | E_NAME | E_RATE | E_DEPT |
1 | A | $400.00 | |
2 | B | $200.00 | 1 |
3 | C | $150.00 | 2 |
4 | D | $150.00 | 3 |
5 | E | $120.00 | 1 |
6 | F | $100.00 | 1 |
7 | G | $100.00 | 2 |
8 | H | $50.00 | 2 |
9 | I | $50.00 | 3 |
10 | J | $50.00 | 3 |
11 | K | $150.00 | 3 |
Table: PART Primary Key: P_NO
P_NO | P_NAME | P_CITY |
1 | P1 | NY |
2 | P2 | NY |
3 | P3 | LA |
4 | P4 | SF |
5 | P5 | LA |
6 | P6 | NY |
Table: PROJECT Primary Key: PR_NO
PR_NO | PR_MGR | PR_DEPT | PR_LOC |
1 | 2 | 1 | NY |
2 | 3 | 2 | LA |
3 | 2 | 1 | NY |
Table: SUPPLIER Primary Key: S_NO
S_NO | S_NAME | S_LOC |
1 | S1 | NY |
2 | S2 | NY |
3 | S3 | LA |
Table: SUPPLY
Primary Key: P_NO + PR_NO + S_NO
Foreign Key: P_NO references PART Foreign Key: PR_NO references PROJECT Foreign Key: S_NO references SUPPLIER
P_NO | PR_NO | S_NO | QTY |
1 | 1 | 1 | 111 |
1 | 1 | 2 | 112 |
1 | 1 | 3 | 113 |
1 | 2 | 1 | 121 |
1 | 2 | 2 | 122 |
1 | 2 | 3 | 123 |
1 | 3 | 1 | 131 |
1 | 3 | 2 | 132 |
1 | 3 | 3 | 133 |
2 | 1 | 1 | 211 |
3 | 1 | 1 | 311 |
4 | 1 | 1 | 411 |
5 | 1 | 1 | 511 |
6 | 1 | 1 | 611 |
Table: WORK
Primary Key: ENO + PRNO
Foreign Key: E_NO references EMP Foreign Key: PRNO references PROJECT
E_NO | PR_NO | HRS |
2 | 1 | 10 |
3 | 2 | 20 |
5 | 1 | 20 |
5 | 2 | 20 |
5 | 3 | 20 |
6 | 1 | 10 |
6 | 2 | 10 |
Questions:
- Compute the amount to be billed to each project as “Amount”. The amount for each project is computed as the sum of the amount billed to the project by all employees working on the project. The amount billed by an employee to a project is obtained as the product the hours (HRS) that the employee devotes to the project and the billing rate (ERATE) for the employee (show only the output of the query).
- Compute the total revenue generated by each department as “Revenue”. The Revenue for each department is computed as the sum of the amount billed to all projects controlled by the department. (Note that the PRDEPT for a project represents the controlling department for the project) (show only the output of the query).
- List the names of employees who only work in projects located (PRLOC) in New York (NY) (show only the output of the query).
- List the name of employees who work on all projects (show only the output of the query).
List the project numbers (PRNO) for projects that have only received parts that are stored in (PCITY) the same city as the project (show only the output of the query).
Step by Step Solution
★★★★★
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Q1 Compute the amount to be billed to each project as Amount SELECT PRNO SUMHRS ERATE AS Amount FROM ...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