Structural constraints in Entity-Relationship (ER) modeling define how entities take part in relationships. They are called constraints because these limits must be imposed on the data for the DBMS to stay consistent with the requirements.
- Ensure accuracy and consistency in representing real-world relationships.
- Maintain data integrity by enforcing interaction rules between entities.
- Prevent invalid or inconsistent relationships between entities.
- Help design efficient database structures.
- Support reliable data retrieval and meaningful relationships.

Two primary types of constraints are cardinality (the number of entity instances that can be associated through a relationship) and participation (whether all or only some entity instances take part in the relationship). Cardinality can be one-to-one, one-to-many, many-to-one, or many-to-many, while participation can be total or partial.
Cardinality Ratios of relationships: In an ER diagram, entities are drawn as rectangles and relationships as diamonds.
The numbers (such as 1, M and N) written above the lines connecting the relationship to the entities are called cardinality ratios. Each number is the maximum number of entities on that side that a single entity on the other side can be associated with through the relationship R.
Note: The number of times an entity participates in a relationship equals the number of tuples in the relationship that contain it.
Types of Cardinality in ER-Model
There are 4 types of cardinality:
- One-to-one (1:1): An entity in either set is associated with at most one entity in the other set.
- One-to-many (1:N): An entity in the first set can be associated with many entities in the second set, but each entity in the second set is associated with at most one in the first.
- Many-to-one (N:1): An entity in the first set is associated with at most one entity in the second set, but each entity in the second set can be associated with many in the first.
- Many-to-many (N:N): An entity in either set can be associated with many entities in the other set.

Participation Constraints in ER-Model
Participation Constraints specify whether every entity in an entity set must take part in a relationship. Participation can be total or partial.
Total Participation
When every entity in an entity set must participate in at least one relationship instance, it is called total participation. It is shown by a double line between the entity and the relationship in an ER diagram.
- In a university system, every student must be enrolled in at least one course, so Student has total participation in the relationship with Course.
- If every professor must teach at least one course, then Professor also has total participation in the relationship with Course.
Partial Participation
When some entities in an entity set may not participate in the relationship, it is called partial participation. Contrary to total participation, it allows entities to exist without being part of any relationship. It is shown by a single line in an ER diagram. For instance, if some professors do not teach any courses, their participation in the "Teaches" relationship is partial.

