# Constraint In ER Model:

There are two types of constraint in ER model

Mapping Cardinalities
Participation Constraints

## Mapping Cardinalities or Cardinality Ratios:

It tells the number of entities to with another entity can be associated through a 'relationship set' . Mapping cardinality uses binary relationship sets.

So a binary relationship set R between entity set A and B there will be one of this mapping cardinality.

### One to One Mapping Cardinality

An entity in A is associated with " at most " One entity in B and an entity in B is associated with at most one entity in A.

### One to Many Mapping Cardinality

An entity in A is associated with any number(Zero more) of entities B. An entity in B, however, can be associated with at most one entity in A

### Many to One Mapping Cardinality

An entity in A is associated with at most one entity in B. An entity in B, however can be associated with any number (zero or more) of entities in A.

### Many to Many Mapping Cardinality

:An entity in A is associated with any number(zero or more) of entities in B, and an entity in B is associated with any number (zero or more) of entities in A.

## Participation Constraints:

The participation of an entity set E in a relationship set R is said to be ' total' if every entity in E participate in at least one relationship in R. If only some entities in E participate in relationship in R, then entity set E in relationship R is said to be partial.
```