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

(In SQL) Write a SQL query using the following tables to find the names of the c

ID: 3886806 • Letter: #

Question

(In SQL) Write a SQL query using the following tables to find the names of the companies which have employees residing in all cities where employees of Bank of America live. (So if BOA has employees living in three cities, each company returned by this query must have employees living in all these three cities.)

Employee (Lastname, FirstName, MidInitial, gender, street, city)

Works (Lastname, FirstName, MidInitial, company-name, salary)

company (company-name, city)

Manages(Lastname, FirstName, MidInitial, ManagerLastname, MFirstName, MMidInitial, start-date)

Explanation / Answer

Please find my answer.

select company-name

from Company c, Employee e

where e.city in (

select city

from Works

where company-name like 'Bank of America'

)

and e.city = c.city;