Question: Use the following database to answer all parts of this question (show only the Outputs). Table: EMP Primary Key: E_NO begin{tabular}{|l|l|l|l|} hline E_NO & E_NAME




Use the following database to answer all parts of this question (show only the Outputs). Table: EMP Primary Key: E_NO \begin{tabular}{|l|l|l|l|} \hline E_NO & E_NAME & E_RATE & E_DEPT \\ \hline 1 & A & $400.00 & \\ \hline 2 & B & $200.00 & 1 \\ \hline 3 & C & $150.00 & 2 \\ \hline 4 & D & $150.00 & 3 \\ \hline 5 & E & $120.00 & 1 \\ \hline 6 & F & $100.00 & 1 \\ \hline 7 & G & $100.00 & 2 \\ \hline 8 & H & $50.00 & 2 \\ \hline 9 & I & $50.00 & 3 \\ \hline 10 & J & $50.00 & 3 \\ \hline 11 & K & $150.00 & 3 \\ \hline \end{tabular} Table: PART Primary Key: P_NO \begin{tabular}{|l|l|l|} \hline P_NO & P_NAME & P_CITY \\ \hline 1 & P1 & NY \\ \hline 2 & P2 & NY \\ \hline 3 & P3 & LA \\ \hline 4 & P4 & SF \\ \hline 5 & P5 & LA \\ \hline 6 & P6 & NY \\ \hline \end{tabular} Table: PROJECT Primary Key: PR_NO \begin{tabular}{|l|l|l|l|} \hline PR_NO & PR_MGR & PR_DEPT & PR_LOC \\ \hline 1 & 2 & 1 & NY \\ \hline 2 & 3 & 2 & LA \\ \hline 3 & 2 & 1 & NY \\ \hline \end{tabular} Table: SUPPLIER Primary Key: S_NO \begin{tabular}{|l|l|l|} \hline S_NO & S_NAME & S_LOC \\ \hline 1 & S1 & NY \\ \hline 2 & S2 & NY \\ \hline 3 & S3 & LA \\ \hline \end{tabular} 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 \begin{tabular}{|l|l|l|l|} \hline PN N & PR_NO & S_NO & QTY \\ \hline 1 & 1 & 1 & 111 \\ \hline 1 & 1 & 2 & 112 \\ \hline 1 & 1 & 3 & 113 \\ \hline 1 & 2 & 1 & 121 \\ \hline 1 & 2 & 2 & 122 \\ \hline 1 & 2 & 3 & 123 \\ \hline 1 & 3 & 1 & 131 \\ \hline 1 & 3 & 2 & 132 \\ \hline 1 & 3 & 3 & 133 \\ \hline 2 & 1 & 211 \\ \hline 3 & 1 & 1 & 311 \\ \hline 4 & 1 & 1 & 411 \\ \hline 5 & 1 & 1 & 511 \\ \hline 6 & 1 & 1 & 611 \\ \hline \end{tabular} Questions: 1. 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 (E_RATE) for the employee (show only the output of the query). 2. 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 PR DEPT for a project represents the controlling department for the project) (show only the output of the query). 3. List the names of employees who only work in projects located (PR_LOC) in New York (NY) (show only the output of the query). 4. List the name of employees who work on all projects (show only the output of the query). 5. List the project numbers (PR_NO) for projects that have only received parts that are stored in (P_CITY) the same city as the project (show only the output of the query)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
