 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are constraints on ER model in DBMS?
Constraints are used for modeling limitations on the relations between entities.
There are two types of constraints on the Entity Relationship (ER) model −
- Mapping cardinality or cardinality ratio. 
- Participation constraints. 
Mapping Cardinality
It is expressed as the number of entities to which another entity can be associated via a relationship set.
For the binary relationship set there are entity set A and B then the mapping cardinality can be one of the following −
- One-to-one 
- One-to-many 
- Many-to-one 
- Many-to-many 
One-to-one relationship
An entity set 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 relationship
An entity set A is associated with any number of entities in B with a possibility of zero and an entity in B is associated with at most one entity in A.

Many-to-one relationship
An entity set A is associated with at most one entity in B and an entity set in B can be associated with any number of entities in A with a possibility of zero.

Many-to-many relationship
An entity set A is associated with any number of entities in B with a possibility of zero and an entity in B is associated with any number of entities in A with a possibility of zero.

Participation Constraints
Participate constraints are two types as mentioned below −
- Total participation 
- Partial Participation 
The participation constraints are explained in the diagram below −

Here, the customer to Loan is partial participation and the loan to the customer is total participation.
Total participation
The participation of an entity set E in a relationship set R is said to be total if every entity in E Participates in at least one relationship in R.
For Example − Participation of loan in the relationship borrower is total participation.
Partial Participation
If only some of the entities in E participate in relationship R, then the participation of E in R is said to be partial participation.
For example − Participation of customers in the relationship borrower is partial participation.
