Database Design Process

What are the relationships in RDBMS? Explain the different types of relationships.

A logical connection between different entities is called relationship. The relationship indicates how the entities are connected or related to each other. The entities that participate in a relationship are called participants. The relationship may be between different entities or between an entity and itself.

Types of Relationships
These are the different types of relationships:

  1. One-to-One Relationship
  2. One-to-Many Relationship
  3. Many-to-Many Relationship

One-to-One Relationship
This type of relationship is used when “for each instance in first entity class, there is only one instance in the second entity class and for each instance in second entity class, there is only one instance in the first entity class”. For Example, one manager manages one branch of a branch of a bank. Similarly, one branch of a bank is managed by one manager.

One-to-Many Relationship
This type of relationship is used when “for each instance in first entity class, there can be many instances in the second entity class and for each instance in second entity class, there is only one instance in the first entity class”. For Example, one college can have many departments but one department is part of only one college.

Many-to-Many Relationship
This type of relationship is used when “for each instance in first entity class, there can be many instances in the second entity class and for each instance in second entity class, there can be many instances in the first entity class”. For Example, one reader may read many books and one book may be read by many readers.