Question
employee(employee-id, employee-name, street, city) works(employee-id, company-id, salary) company(company-id, company-name, city) manages(employee-id, manager-id) Figure 2. Employee database Note: For each tuple of the manages relation, the
employee(employee-id, employee-name, street, city)
works(employee-id, company-id, salary)
company(company-id, company-name, city)
manages(employee-id, manager-id)
Figure 2. Employee database
Note: For each tuple of the manages relation, the manager-id is the managers employee id.
Q. Consider the employee database of Fig. 2, where the primary keys are underlined. Given an SQL query for each of the following questions.
a. Find the names of all employees who work for First Bank Corporation.
b. Find the names and cities of residence of all employees who work for First Bank Corporation.
c. Find all employees in the database who live in the same cities as the companies for which they work.
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