0% found this document useful (0 votes)
10 views14 pages

Normalisation Workbook: First Normal Form (1NF)

The document outlines the principles of database normalization, focusing on First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF). It provides rules for each form, examples of non-atomic data, and exercises to identify and correct normalization issues in tables. The document also includes worked examples and redesign suggestions for achieving higher normalization forms.

Uploaded by

mxkydoesamvs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views14 pages

Normalisation Workbook: First Normal Form (1NF)

The document outlines the principles of database normalization, focusing on First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF). It provides rules for each form, examples of non-atomic data, and exercises to identify and correct normalization issues in tables. The document also includes worked examples and redesign suggestions for achieving higher normalization forms.

Uploaded by

mxkydoesamvs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Normalisation Workbook

First Normal Form (1NF)

The rules for 1NF:

• Each data item cannot be broken down any further i.e. it is ‘atomic’
• Each row/record is unique and has a primary key
• There are no records with repeating data
• Each field should be unique

Atomic data

Rule 1: Each data item cannot be broken down any further i.e. it is ‘atomic’

State whether the following examples are atomic or non atomic


Data Atomic or non atomic

Miss Jane Green

9 Oak Crescent, Warwick

Teacher

01926 123456

King George IV School London

CV11 9NB

Keyboard

Star Trek 12A

Jaguar XJS

Buckingham Palace

Supersize cheeseburger

Change the following examples of non atomic data into atomic data

© www.teach-ict.com All Rights Reserved


Non Atomic Atomic

Name: Sally Chadwick First name: Sally


Surname: Chadwick

Address: 9 Oak Crescent,


Snitterfield, CV11 9NB

King George IV School London

Star Trek 12A

Jaguar XJS

Rule 2: Each row/record is unique and has a primary key

The records below have no primary key. Choose a suitable primary key and
complete the table.

Title First Name Surname Dob


Mr James Smith 14/05/57
Miss Emma White 21/11/78

The records below have no primary key. Choose a suitable primary key and
complete the table.

FilmTitle Rating Genre


Dr Strange PG-13 Sci Fi
Zootopia U Children

Rule 3: There are no records with repeating data

Look at the tables below and answer the questions:

© www.teach-ict.com All Rights Reserved


Table 1:
ID* Title Surname Telephone no
001 Miss Smith 01234 567890
002 Miss White 01234 890123
003 Miss James 01234 798453
004 Miss Green 01234 578345

Is this table in 1NF? Yes No

Reason:

Table 2:
ID* Title Surname Full Name Telephone
no
001 Mrs Field Mrs Field 01234 523645
002 Miss White Miss White 01234 890123
003 Mr Hancock Mr Hancock 01234 989654
004 Miss Green Miss Green 01234 578345

Is this table in 1NF? Yes No

Reason:

Table 3:
ID* Title Surname Email
001 Mrs Field [email protected]

002 Miss White [email protected]


[email protected]
003 Mr Hancock [email protected]

004 Miss Green [email protected]


[email protected]

Is this table in 1NF? Yes No

Reason:

© www.teach-ict.com All Rights Reserved


Rule 4: Each field name should be unique

Look at the tables below and answer the questions:

Table 1:

ID* Title Surname Telephone Telephone Telephone


no no no
001 Mr Smith 01234 567890 01234 789123 01234 345678
002 Miss White 01234 890123 01234 456789 01234 213456

Is this table in 1NF? Yes No

Reason:

Table 2:

ID* FirstNam Surname Course Module Module


e
00123 Tamsin Wall Business Accounts Economics
Studies
00245 Steven Weeks Business Operations Business Law
Studies Management

Is this table in 1NF? Yes No

Reason:

© www.teach-ict.com All Rights Reserved


Identifying tables in First Normal Form (1NF)

Remembering all of the rules of First Normal Form, identify which of the
following tables are in 1NF. Explain your reason

Example 1:

Title FirstNam Surnam Address City Postcode


e e
Mr Tom Smith 42 Mill Street London SE31 1WE

Is this table in 1NF? Yes No

Reason:

Example 2:

ID* Usernam Last Activity Result AccountActi


e accessed ve
1003 Smithj08 2016 12 Save file Success Y
21: 14:03

Is this table in 1NF? Yes No

Reason:

Example 3:

ItemID* Produc Descripti Size Colour Colour Colour


t on
234 Shoe High Heel 6 Red Blue Green

Is this table in 1NF? Yes No

Reason:

Example 4:

StudentID* FirstName Surname SchoolID ClassID


354 Tom James 016 5F

Is this table in 1NF? Yes No

Reason:

© www.teach-ict.com All Rights Reserved


Example 5:

ID* Title FirstNa Surnam Full Addres City Postcod


me e name s e
004 Mr Tom Smith Tom 42 Mill London SE31
Smith Street 1WE

Is this table in 1NF? Yes No

Reason:

Example 6:

ID* Film Rating Genre Actor Length


004 Dr Strange PG-13 Sci Fi Benedict 180 mins
Cumberbatc
h

Is this table in 1NF? Yes No

Reason:

1NF Worked Example

Entity – Band
Entity – Fan

Each band has many fans. Each person is a fan of only one band.

Taking this information into account, draw the correct ER diagram below:

BAND FAN

The attributes of the


The attributes of the
fans might be:
band might be:
 Fan ID
 Band ID
 First Name
 Band Name
 Surname
 Music Type
 Email Address

© www.teach-ict.com All Rights Reserved


Write the correct database notation for each table.

BAND ( )

FAN ( )

The database designer sets up the FAN table:

FanID* FirstName Surname BandID Email


001 Tom Smith 23 [email protected]

002 Jane Green 43 [email protected]


m
[email protected]

Identify the problem with this table:

Answer:

The database designer has a second go at setting up the FAN table:

FanID FirstNam Surnam BandID Email Email


* e e
001 Tom Smith 23 [email protected]

002 Jane Green 43 [email protected] [email protected]

Identify the problem with this new design.

Answer:

© www.teach-ict.com All Rights Reserved


The database designer finally comes up with the correct solution. He needs
to create a third table called EMAIL and use a foreign key in the fan table to
link to the primary key in the EMAIL table.

Complete the ER diagram below:

BAND FAN

EMAI
L

Complete the three tables for this database below and add one record for
each. Indicate the primary keys by using a *

BAND

FAN
FanID* FirstNa Surnam BandID EmailID
me e
001 Tom Smith 23 012

EMAIL

© www.teach-ict.com All Rights Reserved


Second Normal Form (2NF)

The rules for 2NF:

• The table must be in 1NF


• Non-key attributes must depend on every part of the primary key

Venue* Artist* Date* Attendan Profit Style


ce
Wembley Adele 14/12/16 23000 12334 Female
soloist
NEC Taylor 18/12/16 15000 43025 Female
Swift soloist

Identify the key attributes in this table:

Identify the non-key attributes in this table:

Does every non-key attribute depend on every key attribute?

If your answer above was no, is this table in 2NF?

If it is not in 2NF, identify which non-key attribute does not depend on one of
the key attributes.

Answer:

© www.teach-ict.com All Rights Reserved


Redesign this database so that it is in 2NF

CONCERT:
Venue* ArtistID* Date* Attendanc Profit
e
Wembley 002 14/12/16 23000 12334

ARTIST:

ArtistID*

STYLE:

StyleID*

2NF another example

PROJECT:
EmployeeID* ProjectID* DateHired ProjectManag
er

Identify the key attributes in this table:

Identify the non-key attributes in this table:

Does every non-key attribute depend on every key attribute? Explain your
answer

Redesign this database so that it is in 2NF


10

© www.teach-ict.com All Rights Reserved


PROJECT:

EMPLOYEE:

PROJECTMANAGER:

2NF another example

COURSES:
CourseID* Term* PlacesAvailab CourseTitle
le
001 Autumn 50 Computing
001 Spring 40 Computing
001 Summer 45 Computing
002 Autumn 100 ICT
002 Spring 90 ICT
003 Summer 100 Robotics

Identify the key attributes in this table:

Identify the non-key attributes in this table:

Does every non-key attribute depend on every key attribute? Explain your
answer

Redesign this database so that it is in 2NF

11

© www.teach-ict.com All Rights Reserved


COURSES AVAILABLE:

COURSE:

12

© www.teach-ict.com All Rights Reserved


Third Normal Form (3NF)

The rules for 3NF:

• The table must be in 2NF


• There are no non-key attributes that depend on another non-key
attribute
• Every non-key attribute is non-transitively dependent on the primary
key

Example 1: Concert table

Venue* Artist* Date* Attendanc Profit City Country


e
Wemble Adele 14/12/1 23000 12334 London UK
y 6
NEC Taylor 18/12/1 15000 43025 Birmingha UK
Swift 6 m
Carnegi Calvin 20/12/1 13453 16785 New York USA
e Hall Harris 6

Key attributes: Venue, Artist, Date

Non-key attributes: Attendance, Profit, City, Country

The table is in 2NF but it is not in 3NF because ‘Country’ could be derived
from ‘City’

Country could be stored in another table e.g.

City* Country

London UK

Birmingham UK

New York USA

The new table called ‘countries’ has City as the primary key and ‘country’ as
an attribute.
The concert table has ‘city’ as a foreign key. Now there is no redundant
data.

13

© www.teach-ict.com All Rights Reserved


3NF – an example

COURSES AVAILABLE:
CourseID Term* PlacesAvailabl TeacherID Teacher
* e
001 Autumn 50 024 Mrs White
001 Spring 40 024 Mrs White
001 Summer 45 019 Mr Brown
002 Autumn 100 024 Mrs White
002 Spring 90 031 Miss
Green
003 Summer 100 026 Mr Black

Is this table in 3NF?

If you answered ‘no’, explain your reason.

Redesign this database so that it is in 3NF

COURSES AVAILABLE

TEACHER

14

© www.teach-ict.com All Rights Reserved

You might also like