Components of Databases: (1)
A database is:
A collection of data or information which is held together in an organised or logical way.
A record is:
All of the data or information about one person or one thing.
A field is:
One piece of data or information about a person or thing.
The primary key is a field in a table which allows each record to be uniquely identified.
Types and processes within databases:
A database which contains only one table.
Where data is unnecessarily repeated
Every foreign key value has a matching value in the corresponding primary key. Referential integrity uses these to ensure that there are no orphan records i.e. it prevents you from deleting related records.
Foreign key – customer ID in rentals table, primary key – customer ID in customer table
Components of Databases: (2)
Simple primary key:
A simple primary key is made up of a single field only e.g. customer number
Compound or composite primary key:
A compound / composite primary key combines more than one field to make a unique value. e.g. each card in a deck would be identified by its suit and its value – Ace of Hearts
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