Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relational database schema: employee ( employee - name, employee - id , street, e - city ) works ( employee - id

Consider the following relational database schema:
employee(employee-name, employee-id, street, e-city)
works(employee-id, company-id, salary)
company(company-name, company-id, c-city)
manages(employee-id, manager-id)
Specify the following queries on this database schema using the relational operators we discussed in class. Write your answers on a separate sheet of paper in the order that they are specified below.
1. Retrieve the name and address of employees who work for First Bank Corporation.
2. Retrieve the name, street address, and city of residence of all employees who work for Thrifty Industries and earn more than $10,000 per year.
3. Retrieve the name of all employees who live in the same city as the company for which they work.
4. Retrieve the name of all employees who live on the same street and in the same city as do their managers.
5. Retrieve the name of all employees who do not work for First Bank Corporation.
6. Retrieve the name of all employees who earn more than every employee of Small Bank Corporation.
7.(Assume that companies may be located in several cities) Retrieve all companies located in every city in which Thrifty Industries is located.
8. For each company, find the average salary of employees working for that company.
9. For each city, find the number of employees who work for at least one company in that city.

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago