Question: Solve questions 1 and 2 below based on the projects, employees, workon, and rates tables discussed in the class (shown below). Note that the tables



Solve questions 1 and 2 below based on the projects, employees, workon, and rates tables discussed in the class (shown below). Note that the tables contain sample records only. It does NOT represent all the possible records that could be stored in these tables. employees Use subqueries only, find the names of employees located in the same city as where the Eagle project is located and have the same rate category as Smith. Again, do NOT use any functions or constructs that have not been discussed in the class. Furthermore, do NOT use views or inline views. A Question 2 (6 points) Find the rate category associated with the second highest rate stored in the rate table (i.e., the query should return B for the sample database given. However, you should NOT hard code your query.) Again, do NOT use any functions or constructs that have not been discussed in the class. Furthermore, do NOT use views or inline views. A Question 3 (6 points) The query below is based on the bank example discussed in the class. It returns the names of customers who have more than one account at the bank. We discussed utilizing appropriate indexes and rewriting queries to improve query performance. Use these two techniques, improve the performance of this query as much as possible, assuming (1) the customer and the depositor tables are large tables, and (2) it is OK to return duplicate customer names. SELECT DISTINCT c.customer_name FROM customer c, depositor d1, depositor d2 WHERE c.customer_name =d1. customer_name AND c.customer_name =d2.customer_name AND d1.account_number ! d2.account_number A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
