written 8.6 years ago by | • modified 8.6 years ago |
Mumbai University > Information Technology > Sem 3 > Database Management System
Marks: 10 M
Year: Dec 2013
written 8.6 years ago by | • modified 8.6 years ago |
Mumbai University > Information Technology > Sem 3 > Database Management System
Marks: 10 M
Year: Dec 2013
written 8.6 years ago by |
There are domain integrity constraints, entity integrity constraints, referential integrity constraints and foreign key integrity constraints.
Domain Integrity
Domain integrity means the definition of a valid set of values for an attribute. You define
You may also define the default value, the range (values in between) and/or specific values for the attribute. Some DBMS allow you to define the output format and/or input mask for the attribute.
Referential Integrity Constraint
The referential integrity constraint is specified between two tables and it is used to maintain the consistency among rows between the two tables.
The rules are:
You can't enter a value in the foreign key field of the related table that doesn't exist in the primary key of the primary table.
However, you can enter a Null value in the foreign key, specifying that the records are unrelated.
Foreign Key Integrity Constraint
There are two foreign key integrity constraints:
These constraints affect the referential integrity constraint.
Cascade Update Related Fields
Any time you change the primary key of a row in the primary table, the foreign key values are updated in the matching rows in the related table. This constraint overrules rule 2 in the referential integrity constraints.
Cascade Delete Related Rows
Any time you delete a row in the primary table, the matching rows are automatically deleted in the related table. This constraint overrules rule 1 in the referential integrity constraints.