The database schema is as follows:
AIRPORT(city, country, runways); (the last attribute is the number of runways at an airport)
FLIGHT (flightID, day, depart_city, arrive_city, depart_time, arrive_time, plane_type)
PLANE(plane_type, capacity)
Write following queries in SQL and relational algebra:
1) Find the airports with a direct flight to Toronto
2)) Find airports with late flights to Toronto on a big plane. "Late" means departing after 9:00pm; "big" means with capacity 150 passengers or more
3) ) Find cities from which one can fly to Toronto with one change of planes, and using the same type of the aircraft for both legs of the trip.
Write following queries in SQL and relational algebra.
1) Find flight numbers of flights that use a small (capacity less than 50) plane
2) Find all airports with at least 3 runways that have 2 or more flights to Paris a day, or with capacity at least 250.
Assumption: (flightId, day) pairs are unique (i.e., there are no two flights with the same flightId on the same day)