The three major types of integrity constraints are domain constraints, entity integrity, and referential integrity. Using examples, explain these integrity constraints and their usefulness in databases.
1. Domain constraint
This constraint defines the domain of attributes in the database.
the constraint apecifies that the attribute must be atomic from its domain.
2. Entity constraint
It is a constraint that specifies that all primary keys in a relation must have values that are not null.
This ensures that the uniqueness property of the primary key is not violated.
3. Refferential constraint
It is a constraint enforced when a foreign key references the primary key of a relation.
It ensures that all the values taken by the foreign key must either be available in the
relation of the primary key or be null.
Comments
Leave a comment