written 2.6 years ago by |
Relationship
A relationship is used to describe the relation between entities.
Diamond or rhombus is used to represent the relationship.
Types of relationship:
There are four types of relationship:
One-to-One Relationship
One-to-Many Relationship
Many-to-One Relationship
Many-to-Many Relationship
One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is known as one to one relationship.
One-to-many relationship
When only one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship then this is known asaone-to- many relationship.
Many-to-one relationship
When more than one instance of the entity on the left, and only one instance of an entity on the right associates with the relationship then it is known asamany-to- one relationship.
Many-to-many relationship
When more than one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship then it is known asamany-to- many relationship.