Question: For each SQL statement that you construct in the steps below, you must provide the screenshot of your SQL statement. employee(employee-name, street, city) works(employee-name, company-name,

For each SQL statement that you construct in the steps below, you must provide the screenshot of your SQL statement.

employee(employee-name, street, city)

works(employee-name, company-name, salary)

company(company-name, city)

manages(employee-name, manager-name)

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

Note for the purpose of this assignment, I am only looking for SELECT statements. You could create your own data if you would like.

Find the names, street address, and cities of residence for all employees who work for 'First Bank Corporation' and earn more than $10,000.

Find the names of all employees in the database who live in the same cities as the companies for which they work.

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

Find the names of all employees in the database who do not work for 'First Bank Corporation'. Assume that all people work for exactly one company

Find the names of all employees in the database who earn more than every employee of 'Small Bank Corporation'. Assume that all people work for at most one company.

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

Find the names of all employees who earn more than the average salary of all employees of their company. Assume that all people work for at most one company.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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

Students Have Also Explored These Related Databases Questions!