Following are the types of Relationship Mapping,
1. One - to - One Relationship
2. One - to - Many Relationship
3. Many - to - One Relationship
4. Many - to - Many Relationship
1. One - to - One Relationship
In One - to - One Relationship, one entity is related with only one other entity.
One row in a table is linked with only one row in another table and vice versa. For example: A Country can have only one Capital City.
2. One - to - Many Relationship
In One - to - Many Relationship, one entity is related to many other entities.
One row in a table A is linked to many rows in a table B, but one row in a table B is linked to only one row in table A. For example: One Department has many Employees.
3. Many - to - One Relationship
In Many - to - One Relationship, many entities can be related with only one other entity. For example: No. of Employee works for Department.
Multiple rows in Employee table is related with only one row in Department table.
4. Many - to - Many Relationship
In Many - to - Many Relationship, many entities are related with the multiple other entities.
This relationship is a type of cardinality which refers the relation between two entities. For example: Various Books in a Library are issued by many Students.
Participation Constraints
Following are the two types of Participation Constraints,
1. Total Participation
2. Partial Participation
1. Total Participation
In Total Participation, every entity in the set is involved in some association of the relationship.
It is indicated by a double line () between entity and relationship. For example: Every Department must have a Manager.
2. Partial Participation
In Partial Participation, not all entities in the set are involved in association of the relationship.
It is indicated by a single line () between entity and relationship.