Database Normalisation
Database Normalisation
Normalisation
A Level Computer Science
Starter
Define the following on your screens:
Primary Key
Composite Primary Key
Entity
Attribute
Relationship
Database Structure
We learned a few basic ideas for structuring a
relational database last lesson:
Each entity should have its own table
Foreign keys create one-to-many relationships
A many-to-many relationship needs a link table
Database Normalisation
While these basic ideas will work nicely for smaller
structures, we need a formal set of rules for larger
databases
Normalisation is the formal process for creating
the most efficient database structure
Normalised databases will:
Minimize data repetition
Eliminate data redundancy
Eliminate update anomalies
Normalisation
There are three stages to normalisation:
First normal form
Second normal form
Third normal form
Forthe exam, you need to understand what each
stages does and why it is needed, but you are
unlikely to need to fully normalise a database
from scratch.
Loans
Advantages of normalisation:
minimizes data repetition
Eliminates data redundancy and inconsistency
Eliminates update anomolies
Exam Question
State two reasons why database designs are usually normalised.
Reason 1:……………………………………………………….…………
………………………………………………………………………………
………………………………………………………………………………
Reason 2:………………………………………………………………….
………………………………………………………………………………
………………………………………………………………………………
(2)
Mark Scheme
All marks AO1 (understanding)
*Minimise data duplication // no unnecessary repeated data; A. reduce for minimise R. eliminate
*Eliminate data redundancy; A. reduce/minimise for eliminate
Eliminate data inconsistency // improve consistency // avoid inconsistency problems;
Eliminate update anomalies; A. example in context A. updates only need to be made in one place
Eliminate insertion anomalies; A. example in context
Eliminate deletion anomalies; A. example in context
NE. easier to update/insert/delete without concrete example or good explanation
NE. fewer errors when updating / inserting / deleting without concrete example or good explanation
NE. saving space / memory
NE. easier / faster to query
Note: Only award one of the two marks with *. ie a response cannot get two marks for discussion of
only duplication and redundancy
Exam Question 2
State two properties that the relations in a fully normalised database must have.
Property 1:…………………………………………………………………………
……………………………………………………………………………………………
…………………………………………………………………………………
Property 2:…………………………………………………………………………
……………………………………………………………………………………………
…………………………………………………………………………………
(2)
Mark Scheme 2
Data is atomic // no repeating groups (of attributes);
R No repeated columns / attributes / data / values
No partial (key) dependencies // No (non-key) attribute depends on part of the
primary key but not the whole of it // all non–prime attributes are (functionally)
dependent on the whole of every candidate key // (non-key) attributes depend on
the whole key;
No non-key dependencies // No transitive dependencies // (non-key) attributes
depend on nothing but the key;
Every (non-key) attribute is dependent upon the key;
Every determinant is a candidate key;
A “field” for “attribute”
A “part” for “partial”
Task
Complete the exam question on the VLE