Lecture 4: Database Design Flashcards
What can speed up retrieval of data?
Keys and indexes
What to consider designing a database?
– Inclusion of all information
– Selection of correct datatypes
– Creation of keys / indexes
What is normalisation?
Normalisation is the process of efficiently organising data in a database.
Goals of normalisation:
– eliminating redundant data (storing the same
data in multiple tables)
– ensuring data dependencies make sense (only
storing related data in a table).
Makes updating DB more efficient
How many NF are there and which is most common?
0-5 + BCNF
3NF
Explain 1NF
- Eliminate duplicate fields from the same table
- Create separate tables for each group of
related data - Identify each row with a unique value (primary
key)
Explain 2NF
Removes more duplicate information
– There must not be any partial dependency of any column on primary key (bijv. the criminal data only depends on CaseID and not ID)
- The guidelines are:
– Meet 1NF requirements
– Remove subsets of data that apply to multiple rows of
a table and place them in separate tables.
– Create relationships between these new tables and
their predecessors (foreign keys)
3NF requirements
– Meet all 2NF requirements
– Remove fields that are not dependent upon
the primary key (bijv. street and city are dependent on zip code)
Often of third normal form it is said that
the data should “ … depend on the key,
the whole key, and nothing but the
key.”