Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you will submit a .sql file. For each SQL statement that you construct in the steps below, you must provide the screenshot

For this assignment, you will submit a .sql file.

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

You are given the below database

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:

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago