Lecture 10/10/16 - Keys
A key is a value that uniquely indentifies every entry in a particular table. A candidate key is any field that will have a unique value for every record.
How a key is chosen
- Unique, universal, permanent
- Can be 'natural' EG, national insurance number
- Key can be a set of columns
- DBMS can automatically generate a key each time a new record is added to a table
What is a key used for?
Primary keys are used for indexing and searching purposes within its own table.