10
BBBIT BBBIT By the end of today’s lesson; • All of you will understand what 1 st , 2 nd and 3 rd normal form are • Most of you will design a database in 1NF, 2NF and 3NF • Some of you will convert a database between 1NF, 2NF and 3NF Learning Outcomes

Normalisation

Embed Size (px)

Citation preview

Page 1: Normalisation

BBBITBBBIT

By the end of today’s lesson;• All of you will understand what 1st,

2nd and 3rd normal form are• Most of you will design a database

in 1NF, 2NF and 3NF• Some of you will convert a

database between 1NF, 2NF and 3NF

Learning Outcomes

Page 2: Normalisation

BBBIT

Normalisation is when we ensure a database is working in its most efficient way. Its main purpose is to;• Organise the data efficiently• Eliminate redundant data• Ensure that only related data is

stored in a table.

Normalisation

Page 3: Normalisation

BBBIT

The rules for 1NF are;• There are no columns with

repeated or similar data• Each data item is atomic• Each row is unique• Each field has a unique name

1st Normal Form

Page 4: Normalisation

BBBIT

Which is NOT in 1NF?

1NF Example

Page 5: Normalisation

BBBIT

The rules for 2NF are;• Non-key attributes must depend on

every part of the primary key• The table must already be in 1NF

2nd Normal Form

Page 6: Normalisation

BBBIT

How can we change this 1NF database to 2NF?

2NF Example

Page 7: Normalisation

BBBIT

The rules for 3NF are;• There are no non-key attributes

that depend on another non-key attribute

• The table must already be in 2NF

3rd Normal Form

Page 8: Normalisation

BBBIT 3NF Example

Page 9: Normalisation

BBBIT

On your whiteboards convert this database to 1NF.

Task 1

Page 10: Normalisation

BBBIT

On your whiteboards convert this database to 2NF.

Once you have done this create a design for a database in 3NF for an online game database that stores player details, games they play and high scores (max 3 games).

Task 2