Database Reference
In-Depth Information
foreign key constraint uses its reference to refer back to a referenced table, containing the
primary key constraint, to ensure that the two values in the primary key field and foreign
key field match.
It allows us cascading update where records in a foreign table are updated automatically
when the corresponding record in the primary table is changed. There are some specific
circumstances to consider in terms of how Referential Integrity is generally enforced:
 A primary key table is assumed to be a parent table and a foreign key table a child table.
When adding a new record to a child table, if a foreign key value is entered, it must exist in
the related primary key field of the parent table.
 Foreign key fields can contain NULL values. Primary key field values can never contain
NULL values as they are required to be unique.
 When changing a record in a parent table if the primary key is changed, the change must
be cascaded to all foreign key valued records in any related child tables.
 When changing a record in a child table, a change to a foreign key requires that a related
primary key must be checked for existence, or changed first. If a foreign key is changed to
NULL, no primary key is required. If the foreign key is changed to a non-NULL value, the
foreign key value must exist as a primary key value in the related parent table.
 When deleting a parent table record then related foreign key records in child tables
must either be cascade deleted or deleted from child tables first. 4.14 RELATIONAL
ALGEBRA
The relational algebra is a set of eight operators. Each operator takes one or more relations
as input and produces one relation as output. The three main operators of the algebra are
restrict, project and join. Using these three operators most of the manipulation required of
relational systems can be accomplished.
The additional operators - product, union, intersection, difference and division are modeled
on the traditional operators of set theory. There is no standard syntax for the operators of
the relational algebra.
Relational Algebra operations :
select(σ),
project(π),
cross product(×),
union( ),
intersection( ),
Search WWH ::




Custom Search