The fundamental function of the DBMS is to maintain the integrity of the data.
Data integrity ensures that the data in the database is consistent, accurate, correct, and
It ascertains that the data adhere to the set of rules defined by the database
administrator and hence, prevents the entry of the invalid information into database.
The entity integrity constraint states that no primary key (nor any part of the primary
key) value can be null.
This is because the primary key value is used to identify individual rows in a table.
Having null value for the primary key implies that we cannot identify some rows.
This also specifies that there may not be any duplicate entries in primary key column.
The referential integrity constraint is specified between two tables and is used to
maintain the consistency among rows in the two tables.
Informally, the referential integrity constraint states that a row in one table that refers
to another table must refer to an existing row in that table.
It is a rule that maintains consistency among the rows of the two tables.
A domain represents a set of values that can be assigned to an attribute.
Domain integrity constraint is specified on the column of a table, so that correct values can be entered in the column for each record.
The domain integrity states that every element from a relation should respect the type and restrictions of its corresponding attribute.
Assertions are general purpose checks that allow the enforcement of any condition over the entire database.
When an assertion is made, the system tests it for validity, and tests it again on every update that may violate the assertion.
This testing may introduce a significant amount of overhead; hence assertions should be used with great care.
A trigger is a procedure that is automatically invoked by the DBMS in response to
specified changes to the database.
A database that has a set of associated triggers is called an active database.
Triggers are useful mechanisms for alerting humans or for starting certain tasks
automatically when certain conditions are met.
Trigger follows the Event-Condition-Action Scheme (ECA Scheme).
To design a trigger mechanism, we must meet following three requirements:
o Event: A change to the database that activates the trigger.
o Condition: Trigger performs some action only if a specified condition matches at the occurrence of the event.
o Action: A procedure that is executed when the trigger is activated and its condition is true.