Reputation:
I am making designing a database of airports and how they are linked to each other via route. Idea is simpler version of openflights.
This is my ERD:
It has four entities namely: Airport, Route, Airline and Airplane. Relations are as follows: binary relation(departure and destination) between airport and route, Airline serves that route and finally airline has a airplane which is usually used on that route.
I am not sure of validity of entities involved and their relations. It would be nice if someone can point to my mistakes.
Upvotes: 1
Views: 7553
Reputation: 174624
I would not call this a routing table.
Routes have way points and tracks, which are subject to change. For example, the route from KFJK to KORD is COATE Q436 EMMMA WYNDE5
(these are waypoints and WYNDE5 is the arrival at O'Hare).
Your diagram is more of a destinations table. Most flights are single leg ("direct") and for multi-leg flights you need to track those separately.
I would track flights (which have a unique number) instead of your "route number" variable. A flight can be flown by different equipment. For example, the same flight can be flown in a 777 or a A380.
Many airlines fly the same route but use different flights; each flight consists of the following:
The route flown is predefined. Have a look at this table of flights between Kennedy International and Chicago O'Hare.
If you click on the ident column (this is the flight number), you'll see the route flown for that flight.
I would make the following changes:
Upvotes: 1
Reputation: 55524
Several questions come to mind:
Route
are_No
, Dep_air
and Dest_air
?no_of_stops
: Is the number really sufficient or do you need the stops?ends_ad
and starts_from
and intersection? (hope I've read this right?)airport
route_No
?Route
< has > airline
M-M
? Wouldn't each airline operate their own routes even if they use the same airports?airline
modelNo
?no_of_planes
: You already got that information implicitly, usually no need to store it again.aeroplane
: Are these the actual airplanes (e.g. one airline would have several instances of Airbus A380?). If so, an additional table defining the types might make sense.General:
Route
vs airline
Dest_air
vs destination_airport
modelNo
vs route_No
Edit: Since you decided to ignore intermediary stops, this is what your model could look like:
Upvotes: 0