In: Computer Science
In a N:M relationship which entity is the parent? Why?
In an N : M relationship, both of the entities may be the parent.
Explanation:
An ER model is not a complete model and there is no database available that is completely based on the ER model. Generally, the high-level design is done in the ER model and implementation is done in the relational model.
A relationship is an association, link, or connection between the instance of the different entity types.
Cardinality means the number of instances of one entity type that can possibly be related to the maximum of how many instances of another entity type.
Many to many(N:M) means one to many from both sides.
Let us suppose we have two entities A and B and the cardinality of these entities is N: M.
If the instance of entity A is associated with many of the instances of entity B then entity A is the parent entity and entity B is the child entity.
If the instance of entity B is associated with many of the instances of the entity A then entity B is the parent entity and the entity A is the child entity.
So, both of the entities may be the parent entity or child entity.