Question: Consider the employee database of Figure, where the primary keys are underlined. Give an expression in SQL for each of the following queries. a. Find

Consider the employee database of Figure, where the primary keys are underlined.

Give an expression in SQL for each of the following queries.

a. Find the names of all employees who work for First Bank Corporation.

b. Find the names and cities of residence of all employees who work for First Bank Corporation.

c. Find the names, street addresses, and cities of residence of all employees who work for First Bank Corporation and earn more than $10,000.d find all employees in the database who live in the same cities as the companies for which they work.

e. Find all employees in the database who live in the same cities and on the same streets as do their managers.

f. Find all employees in the database who do not work for First Bank Corporation.

g. Find all employees in the database who earn more than each employee of Small Bank Corporation.

h. Assume that the companies may be located in several cities. Find all companies located in every city in which Small Bank Corporation is located.

i. Find all employees who earn more than the average salary of all employees of their company.

j. Find the company that has the most employees.

k. Find the company that has the smallest payroll.

l. Find those companies whose employees earn a higher salary, on average, than the average salary at First BankCorporation.

employee (employee-name, street, city) works (employee-name, company-name, salary) m (mpa-name, city) ages

employee (employee-name, street, city) works (employee-name, company-name, salary) m (mpa-name, city) ages (emplo-, ager-name)

Step by Step Solution

3.37 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Find the names of all employees who work for First Bank Corporation select employeename from works where companyname First Bank Corporation b Find the names and cities of residence of all employees ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

16-CS-DB (135).docx

120 KBs Word File

Students Have Also Explored These Related Databases Questions!