Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a) Consider the following relational database where the primary keys are underli

ID: 3623013 • Letter: A

Question

a)

Consider the following relational database where the primary keys are
underlined:
person(person name, street, city) // records about all people
works(person name, company name, annual salary) // records about employeed people
company(company name, founded)
company location(company name, city) // companies and cities where they have oces
managed by(person name, manager name)
In the above database, identify all the foreign keys.

b)

(a)  Find the names of all employees who work for company C2 and earn more than $70,000 annually.

(b)  Find the names of all employees who are not managers.

(c)  Find the names of all employees who live in one of the cities where their companies have offices

Explanation / Answer

1.works(person name) references person(person name) 2.works(company name) references company(company name) 3.company location(company name) references company(company name) 4.managed by(person name) references person(person name) ------------------------------------------------- 1.select personname from works where company name='C2' and salary>70000 2.select personname from person where personname not in(select personname from managed by) 3.select personname from works,person,company location where works.person name=person.person name and works.company name=company location.company name