2

My objective is to make a database of airports, cities and the airlines which provide coverage to them. enter image description here

I asked the question before on stackoverflow and the person told me to break up the many-to-many relationship between airport and airline(I agree with that). Moreover, he/she raised objection on relationship between airline and country.

I thought an airline belongs to a country so i made a relationship between two. Kindly, give your suggestions on the ERD and how i can improve it?

3
  • 2
    Will you not store the routes that an airline operates? (if yes, the airport-airline relationship is not needed, the relevant info will be in the routes table or tables). Commented May 9, 2014 at 16:37
  • What specific advice are you looking for? As it stands, your design is perfectly reasonable, without knowing what problem you are trying to solve.
    – Hannah Vernon
    Commented May 9, 2014 at 16:51
  • @MaxVernon My objective is to make a DB of top 25 airports and the airlines covering those airports as well. I am still amateur so i am sorry for not conveying properly.
    – chaudry
    Commented May 9, 2014 at 18:40

2 Answers 2

3

Name your relationships. For example the line from Airport to Airline - is that "based out of", "offers service to" or "banned from landing in"? Any or all may be valid in your problem space but without good names the subtle differences will not become apparent. And be honest with yourself. Using names like "has" and "relates to" is a cop out.

You relate an Airport to one City. What about Dallas/Fort Worth?

Have a think about the output you will want from this system. Work through the corresponding queries in your mind and verify the ERD satisfies them. If not, you have to refine your rules and model them appropriately.

3

Looks ok.

Some countries span multiple continents, such as Russia and Turkey.

Some airports might not be in cities, like Mirabel (YMX), which is 53k from Montreal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.