147 0 Newbie Poster

Use Relational Algebra to express the following queries on the schema FLIGHTS (DepartureCity, ArrivalCity). A pair of cities a, b is in an instance of relation FLIGHTS if there is a direct flight from city a to city b. The relation is always antireflexive: that is, there are no flights from a city to itself.

a) Cities from which there are direct flights to exactly three cities.
b) Cities with flights to exactly all cities from which there is exactly one flight.
c) Cities from which there are direct flights to exactly three cities.
d) Cities from which there are flights only to cities which have flights among all of them.