Database Reference
In-Depth Information
According to definition, NULL value of primary key is not allowed therefore marked row
cannot be recorded into a database.
4.13 Referential Integrity
Referential Integrity ensures the integrity of relationships between primary and foreign key
values in related tables. In a relation between two tables, one table has a primary key and
the other a foreign key. The primary key uniquely identifies each record in the first table.
There can be only one record in the first table with the same primary key value. The foreign
key is placed into the second table in the relationship such that the foreign key contains a
copy of the primary key value from the record in the related table.
Primary and foreign keys are both constraints. A constraint is a piece of metadata (data
catalog) defined for a table defining restrictions on values. A primary key constraint forces
the primary key field to be unique.
The integrity constraints that ensure that relationships between entities remain valid. No
record in the foreign table can contain a foreign key that doesn't match a record in the
primary table.
Referencing (or referential) foreign key constraints can be in any table, including the same
table as the primary key constrained field referenced by the foreign key (a self join). A
Search WWH ::




Custom Search