Explain the various types of constraints on relationship types of the E-R model.

Database Management System >   DBMS Data Models >   Components of ERD  

Long Question

16047


Answer:

The constraints on the relationship type are of two types, namely, mapping cardinalities and participation constraint. These two constraints are collectively known as structural constraints of a relationship type.

Mapping cardinalities

The maximum number of instances of one entity type to which an instance of another entity type can relate to is expressed by the mapping cardinalities or cardinality ratio (Figure below). The mapping cardinalities can be used to describe the relationship between two or more entities. For a binary relationship between two entity types E1 and E2, the mapping cardinalities can be of four types:

One-to-one: In one-to-one mapping, each instance of entity type E1 is associated with at most one instance of entity type E2 and vice-versa. It is represented by 1:1 relationship. For example, consider two entities PERSON and DRIVING_LICENSE. Each person can only have one driving license, and one driving license with a particular number can only be issued to a single person. That is, no two persons can have the same driving license. Thus, these two entities have 1:1 relationship.

One-to-many: In one-to-many mapping, each instance of entity type E1 can be associated with zero or more instances of type E2. However, an instance of type E2 can only be associated to at most one instance of E1. It is represented by 1:M relationship. For example, one publisher can publish many books; however, one book (with a particular ISBN) can only be published by one publisher. Thus, the entities PUBLISHER and BOOK have 1:M relationship.

Many-to-one: In many-to-one mapping, each instance of entity type E1 can be associated with at most one instance of type E2. However, an instance of type E2 can be associated with zero or more instances of type E1. It is represented by M:1 relationship. For example, different books can be published by one publisher; however, one book can only be published by one publisher. Thus, the entities BOOK and PUBLISHER have M:1 relationship.

Many-to-many: In many-to-many mapping, each instance of entity type E1 can be associated with zero or more instances of type E2 and an instance of type E2 can also be associated with zero or more instances of type E1. It is represented by M:N relationship. For example, one author can write many books and one book can be written by more than one author. Thus, the entities AUTHOR and BOOK have M:N relationship.

Participation constraint

The participation constraint specifies whether an entity instance can exist without participating in a relationship with another entity. In some notations, this constraint is also known as the minimum cardinality constraint. The participation constraints can be of two types, namely, total and partial. If every instance of entity type E participates in at least one relationship instance of type R, the participation is said to be total. On the other hand, if only some of the instances of entity type E participate in the relationship, the participation is said to be partial.


This Particular section is dedicated to Question & Answer only. If you want learn more about Database Management System. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.