Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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