Relationship Mapping in ER Diagram of Databases

Types of Relationship Mapping

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.
one-to-oneone-to-one

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.
one-to-manyone-to-many

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.
many-to-onemany-to-one

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.
many-to-manymany-to-many

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 (total partition double line) between entity and relationship.
    For example: Every Department must have a Manager.
total participation

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 (partial partition single line) between entity and relationship.
partial participation