Data Normalisation (OCR A Level Computer Science)

Revision Note

Neil Southin

Expertise

Computer Science

First Normal Form (1NF)

What is Normalisation?

  • Normalisation is the process of organising a database to reduce data duplication and improve data accuracy and consistency

  • Achieved by applying a set of guidelines (forms), each with specific rules and requirements

  • Enhances database efficiency and maintainability

  • Provides consistency within the database

First Normal Form (1NF)

For a table to be in first normal form it must:

  • Contain atomic values

    • Each column in a table must contain single, indivisible values

  • Have no repeating groups

    • Columns must not contain arrays or lists of values

  • Have unique column names

    • Each column must have a unique name within the table

  • Have a unique identifier (primary key)

    • Each row must have a unique identifier to distinguish it from other rows

This customers table below has no primary key and the name is stored in one field so is not atomic. This table is not in first normal form

1nf

This customers table below has a primary key and the name is stored in two fields so it is atomic 

This table is in first normal form

1nf-2

Second Normal Form (2NF)

Second Normal Form (2NF)

For a table to be in second normal form it must:

  • Fulfil all 1NF requirements

  • Only apply to tables with a compound primary key

  • Have full functional dependency

    • All non-prime attributes (attributes not part of the primary key) must be fully dependent on the primary key

  • Have no partial dependencies

    • Non-prime attributes must not depend on only part of the primary key (in case of a composite primary key)

    • Separate tables should be created for partially dependent attributes

In this table below, Course Title only depends on part of the compound primary key (the course code) and not the Date so this table is not in second normal form

2nf

Third Normal Form (3NF)

Third Normal Form (3NF)

For a table to be in third normal form it must:

  • Fulfil all 2NF requirements

  • Have no transitive dependencies

    • Non-prime attributes must not depend on other non-prime attributes

  • Have each non-prime attribute dependent solely on the primary key, not on other non-prime attributes

  • Have separate tables for attributes with transitive dependencies, and the tables should be linked using a foreign key

In this table below, the certificate depends on the title - this a transitive dependency and so this table is not in third normal form 

3nf

Exam Tip

For a table to be in second normal form it has to be in first normal form.

For a table to be in third normal form it has to be in second normal form.

So if asked for the rules of either second or third normal form make sure you say this.

Worked Example

An airport holds details of flights in a database using the table Flight. An extract of the table is shown below.

wk eg flight details table

The airline wishes to ensure the database is normalised.

i) Describe why the database can be considered to be in First Normal Form

[2]

ii) Describe why the database can be considered to be in Second Normal Form

[2]

iii) Describe why the database can not be considered to be in Third Normal form

[2]

Answer:

 No Repeating fields/data. Data is atomic. Has a primary Key [2]

Is in First Normal Form. Every field is dependent on the primary key [2]

Has a transitive relationship. A non-key field depends on another non-key field. DestinationName depends on DestinationCode [2]

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Neil Southin

Author: Neil Southin

Neil has been a passionate Computing teacher for nearly 20 years, teaching Computing and ICT in a large Sixth Form College.