Write a query in *********** relational algebra********** for the following requ
ID: 3921229 • Letter: W
Question
Write a query in ***********relational algebra********** for the following requests:
a. Find all airlines that fly to all Canadian airports.
b. Find all airlines that fly to a Canadian airport but not to any US Airport.
c. Find the locations of all airports with at least one flight to New York.
Consider the following relational schema. Flight(number:integer,aie string, from: string, to: string) CanAirport(code: string, location: string) USAirport(code: string, location: string) The "from" and "to" fields in the Flight table point to the "code" fields in the airport table. For example, a typical entry in the Flight table might be 56, AIRC, YEG, YYV and a typical entry in the CanAirport table might be YEG, Edmonton.Explanation / Answer
a. select airline from Flight where to in(select code from CanAirport);
b. select airline from Flight where to in(select code from CanAirport) AND to not in(select code from USAirport);
c. select location from CanAirport where code in(select from from Flight where to='New York') UNION select location from USAirport where code in(select from from Flight where to='New York')
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.