A key feature of every table is that it has a
'primary key' for every record. A primary key
provides a way to uniquely identify every
record in a table.
A foreign key is used to link tables
together and create a relationship.
It is a field in one table that is
linked to the primary key in
another table.
Referential integrity forces the rule
that a primary key cannot be
duplicated in a table. It also ensures
that if the primary key one table is
changed, then the foreign keys in
the other tables are also updated.
Rules can be put in place that forces field data to be in a
certain format. For example, a date field may have to use
dd/mmm/yyyy i.e. 02/Sep/2007 and not Sep 2nd 07 for
example. This is called data validation
A relational database can avoid data duplication. It is
made up of two or more tables. Tables are related to one
another Each record in a table has a primary key. A foreign
key provides a link between records in different tables.
Data integrity ensures that data remains conistent across
tables.
Check digit - the last one or two digits in a code
are used to check the other digits are correct.
Lookup table - looks up acceptable values in a
table
Format check - checks the
data is in the right format.
Presence check - checks
that data has been entered
into a field
Length check - checks the
data isn't too short or too long.
Range check - checks that a
value falls within the specified
range