Question: Please prove all typed currently sql query for the Tasks in the Introduction(Not photo), thank you so much. Introduction You are given the below database
Please prove all typed currently sql query for the Tasks in the Introduction(Not photo),
thank you so much.
Introduction
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)
Tasks:
1. Find the names, street address, and cities of residence for all employees who work for 'First Bank Corporation' and earn more than $10,000.
2. Find the names of all employees in the database who live in the same cities as the companies for which they work.
3. Find the names of all employees in the database who live in the same cities and on the same streets as do their managers
4. 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
5. 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.
6. Assume that the companies may be located in several cities. Find all companies located in every city in which 'Small Bank Corporation' is located.
7. 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
