in Databases edited by
1,340 views
2 votes
2 votes

What is the cardinality of this relationship? is m-n cardinality correct? if not, why?

in Databases edited by
by
1.3k views

3 Comments

As per my understanding it is n-1 from passenger to train.

Because one passenger can travel in only one train and a train can contain many(n) passengers. A passenger cannot travel in more than one train at the same time

0
0
Maybe it is M:N because let us say, there are N trains and I can travel from any one of them, or I traveled first from one train and then from another train. So in the database, I have multiple entries with my id with different trains. And in a train multiple passengers can travel. So M:N is correct.
0
0
If we remove the total participation from passengers then what will be the cardinality
0
0

3 Answers

0 votes
0 votes
Yes cardinality of relationship travels is M:N where one entity is participating totally and another is participating partially.

2 Comments

Can you explain why?

This is my explanation:

It is n-1 from passenger to train;

A TRAIN may/may-not have more than 1 passenger [Partial Participation] and a PASSENGER has to travel only in one train at a time [Full Participation]; keeping in view all the attributes of TRAIN.

Let me know why my explanation is incorrect.
0
0
This n to 1  relationship. simple reason is a passenger at a time can travel in only one train while many passengers can travel in a train at a time.
0
0
0 votes
0 votes

The participation of an entity set E in a relationship set R is said to be total if every entity in E must participate in at least one relationship in R. If some entities in E do not participate in relationships in R, the participation of entity set E in relationship R is said to be partial.

In this example, PASSENGERS has total participation, and TRAIN has partial participation. That means every passenger must travel at least one train, and every train may or may not contain passengers. So, it is clear that the cardinality of the above diagram is M:N.

0 votes
0 votes

Yes the cardinality is m:n is correct.On the passengers side the participation is mandatory(total) while on the train side its partial

NOTE:While converting to ER-Model the number of relations will be 3 with a junction table (considered as best design) and derived attribute wont be stored as it can be computed from the stored or the base attribute

edited by