For the schema, (shown below, with primary keys indicated), write RA query for e
ID: 3869727 • Letter: F
Question
For the schema, (shown below, with primary keys indicated), write RA query for each of the following. (State any reasonable assumptions if necessary.) You may write a query in several steps
Employee (person_name, street, city)
Works (person_name, company_name, salary)
Company (company_name, city)
(a) Find the names of all employees in this database who do NOT live in the same city as the company for which they work. [Note: You should understand what “…the same city as the company for which they work” means.]
(b) Find the total number of employees in the company which has the minimum number of employees.
Explanation / Answer
a. the query will result in the employee working on the same city
Select e.employee_name from employee e, works w, company c where e.employee_name = w.employee_name and e.city = c.city and w.company_name = c.company-name
RA
person-name (employee x works x company)
b. employee-name (company x works)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.