Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[32] For the schema shown below, write RA query for each of the following. (State any reasonable assumptions only if necessary.) Employee (person name street,
[32] For the schema shown below, write RA query for each of the following. (State any reasonable assumptions only if necessary.) Employee (person name street, city) Works (person name company name salary) Company (company name city) (a) Find the names, street address, and cities of residence of all employees who work for First Bank Corporation and earn more than $80,000 per annum. (b) Find the names of all employees in this database who live in the same city as the company for which they work. [Hint: Make sure you include all the necessary conditions.] (c) Assume the companies may be located in several cities. Find all companies located in every city in which Small Bank Corporation is located. [Hint: Pay attention to "every city".] (d) Find the names of all employees in this database who do NOT live in the same city as the company for which they work. [Note: You should understand what "... the same city as the company for which they work 33 means.] (e) Assume the companies may be located in several cities. Find all companies located in every city in which Union Pacific (UP) is located. (f) Find the company with the smallest number of employees. [Note: The query should return the name of the company which has the smallest number of employees. Hint: You may first find out the total number of employees of each company, and select the smallest one. Then you can continue on to find the name of the company with smallest number of employees.] (g) Find the company with the largest payroll. [Note: Payroll is the sum of salaries for all employees. The query should return the name of the company which has the largest payroll.] (h) Find those companies whose employees earn a higher salary, on average, than the average salary at First Bank Corporation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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