educative.io

I don't quite understand about the relationship in exercise 2

If ‘The airline has one or more airplanes’, why is not the case that ‘the FLIES relationship between the AIRPLANE and FLIGHT entities has cardinality N:1’?

Hi @lifch !!
The distinction between the cardinality of 1:N and N:1 in a relationship depends on which side of the relationship you are considering as the “one” and which side as the “many.”

In the given design, the relationship is defined as follows:

  • An airplane can be involved in any number of flights.
  • Each flight uses exactly one airplane.

Considering this, let’s break down the cardinality of the FLIES relationship between the AIRPLANE and FLIGHT entities:

  • From the perspective of AIRPLANE (one) to FLIGHT (many):

    • An airplane can be involved in any number of flights.
    • Each flight uses exactly one airplane.
  • From the perspective of FLIGHT (one) to AIRPLANE (many):

    • Each flight uses exactly one airplane.
    • An airplane can be involved in any number of flights.

Both perspectives result in the same relationship interpretation: each airplane can be involved in multiple flights (1:N), and each flight uses one specific airplane (N:1).

The original design correctly captures the fact that a flight uses one airplane (N:1) and an airplane can be involved in multiple flights (1:N). The cardinality of 1:N in this context aligns with the real-world scenario where each flight requires one airplane, and an airplane can be used for multiple flights.

So, in summary, the FLIES relationship between AIRPLANE and FLIGHT entities is appropriately modeled with cardinality 1:N to accurately represent the scenario where an airplane is used in multiple flights (1:N), and each flight uses one airplane (N:1).
I hope it helps. Happy Learning :blush: