Professional Documents
Culture Documents
1. Intro to constraint
2. Domain integrity constraint
1. Entity integrity constraint
2. Referential integrity constraint
Introduction
• Success of a database system depends on
security, integrity and friendliness of the
system.
• Constraints are guidelines or limitations
imposed on database tables to maintain the
integrity, correctness, and consistency of data.
• Constraints can be used to
• verify uniqueness of the data
• prevent insertion of erroneous data
• enforce data linkages across tables
• Types of integrity constraint
• Domain integrity constraint
• Entity integrity constraint
• Referential integrity constraint
Domain integrity constraint
• These constraints set a range
• Types of domain integrity constraint
• Not null constraint - forces a value
• Can be enforced during creation of table
• Table can be altered even after creation
create table tname ( field1 type, field2 type
constraint cname not null, field3 type);
alter table tname modify field1 not null;
Domain integrity constraint