Cardinality Constraint

Tell as maximum number of relationship instances in which the entity(tuple) can participate, this is noting but Cardinality Constraint In DBMS.

There are two types of cardinality constraint

  1. Cardinality Ratios/Mapping Constraint
  2. Participation Contraints

Cardinality Ratios/Mapping Constraint


Cardinality Constraint In DBMS

Participation Constraints - Link


Participation Constraints

1. Many-to-Many Cardinality

  • A tuple in Table A associated with any number of tuples in Table B.
  • A tuple in Table B is associated with any number of tuples in Table A.

Many-to-Many

  • Students can enrol on any number of courses.
  • The course can be enrolled by any number of students.

2. Many-to-One Cardinality

  • A tuple in Table A associated with only one tuple in Table B.
  • A tuple in Table B is associated with any number of tuples in Table A.

Many-to-One

Many-to-One ex.

  • One student(tuple) can enrol in at most one course.
  • One course(tuple) can be enrolled by many students.

3. One-to-Many Cardinality

  • A tuple in Table A associated with any number of tuples in Table B.
  • A tuple in Table B is associated with only one tuple in Table A.

One-to-Many

One-to-Many ex.

  • Student can enroll on any number of courses.
  • The course can be enrolled by only one student.

4. One-to-One Cardinality

  • A tuple in Table A associated with only one tuple in Table B.
  • A tuple in Table B is associated with only one tuple in Table A.

One-to-One

One-to-One ex.

  • One student can enrol in one course.
  • One course(tuple) can be enrolled by at most one student(tuple).