Constraints

There are two types of constraints: 
  1. Mapping cardinalities, 
  2. Participation constraints
1. Mapping cardinalities

Mapping cardinalities, also known as cardinality ratio, expresses the number of entities to which another entities can be associated via relationship set.

The mapping cardinality must be one of the following types for describing a binary relationship set R between entity set A and B
  • One to one: An entity in A is associated with at most one entity in B, and entity in B is associated with at most one entity in A
  • One to many: An entity in A is associated with zero or more number of entities in B. While an entity in B can be associated with at most one entity in A
  • Many to one: An entity in A is associated with at most one entity in B. While an entity in B, can be associated with zero or more number of entities in A
  • Many to many: An entity in A is associated with zero or more number of entities in B, and an entity in B is associated with zero or more number or entities in A.


(a)                                                                   (b)

(c)                                                                      (d)

Figure – 1: Mapping Cardinalities (a) One to One (b) One to Many (c) Many to One (d) Many to Many.

2. Participation Constraints

If every entity in E participates in at least one relationship in R, then the participation of an entity set E in a relationship R is said to be total. If only some entity in E participates in relationships in R, then the participation of an entity set in E in relationship R is said to be partial. For example, every loan entity is related to at least one customer through borrower relationship. Hence, such participation is said to be total. In contrast, the person can be a bank customer whether or not the person has a loan with the bank. Hence, such participation is said to be partial.

Comments

Popular posts from this blog

A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrolment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modelled. Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints.

Consider a database used to record the marks that students get in different exams of different course offerings.