0% found this document useful (0 votes)
33 views4 pages

Data Types Worksheet 3 Relational Databases and Normalisation

The document outlines the concepts of normalization in relational databases, specifically defining First, Second, and Third Normal Forms (1NF, 2NF, 3NF). It provides an example of a car sales database, illustrating the issues with a poorly designed table and how to restructure it into compliant tables. Additionally, it discusses the relationships between tables and identifies foreign keys within the database structure.

Uploaded by

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

Data Types Worksheet 3 Relational Databases and Normalisation

The document outlines the concepts of normalization in relational databases, specifically defining First, Second, and Third Normal Forms (1NF, 2NF, 3NF). It provides an example of a car sales database, illustrating the issues with a poorly designed table and how to restructure it into compliant tables. Additionally, it discusses the relationships between tables and identifies foreign keys within the database structure.

Uploaded by

sanjarxsb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Worksheet 3 Normalisation

Unit 4 Exchanging data

Worksheet 3 Relational databases and normalisation


1. Write definitions for
First Normal Form (1NF)
1. All rows must be unique
2. Each cell must only contain a single value (not list)
3. Each value should be non divisible/can’t be split down further

Second Normal Form (2NF)


1. Must follow 1NF
2. No partially dependant

Third Normal Form (3NF)


1. Must follow 2NF
2. No transitive dependency – (All fields must only be determinable by primary/composite
key, not by other keys)

2. A car dealer has several different branches which each sell cars, and a database is being
designed to hold data about the cars they sell and the salespeople who sell them.

● Each branch is identified by town. There is a maximum of one branch in each town

● Each make of car is identified by a unique model name

● Each model of car is made by only one manufacturer

● Each salesperson is identified by their SalesID. The number of each model of car that
they sell (SalesVol) is recorded
A first attempt at designing a table to hold the data has been made. The table, called
CarSales, is shown below with some sample data.

SalesID Name Branch Model SalesVol Manufacturer


(a) Why is this table not in First Normal Form (1NF)?
Clio 3 Renault
S123 Gerry Norwich C3 Picasso 4 Citroen
Civic 5 Honda
Juke 1 Nissan
S555 Shirley Cromer C4 2 Citroen
Octavia 4 Skoda
C3 Picasso 5 Citroen
S442 Dave Cromer
Octavia 1 Skoda

1
Worksheet 3 Normalisation
Unit 4 Exchanging data
1. This table does contain list values in rows, which breaks the law of first normal form.

(b) The data is split into two tables. Show the contents of the two tables
Table: SalesPerson

SalesID Name Branch


S123 Gerry Norwich

S555 Shirley Cromer

S442 Dave Cromer

Table: ProductSales

SalesID Model SalesVol Manufacturer


Clio 3 Renault
S123
C3 Picasso 4 Citroen
S123
Civic 5 Honda
S123
Juke 1 Nissan
S555
C4 2 Citroen
S555
Octavia 4 Skoda
S555
C3 Picasso 5 Citroen
S442
Octavia 1 Skoda
S442

(c) A relationship between the tables has been implemented. Explain how this has been
done.
1. Now each cell contains single values, now, it follows 1NF

(d) Explain why the ProductSales table is not in Third Normal Form (3NF)
Manufacturer depends on Model, not on the primary key (SalesID, Model).
This is a transitive dependency, as the relationship between Model and Manufacturer is
independent of SalesID.

2
Worksheet 3 Normalisation
Unit 4 Exchanging data

(e) Draw an entity relationship diagram to show the entitities in the database in 3NF.

(f) Write the table definitions for the database in 3NF. Use the notation
Tablename (keyfield, Attribute1, Attribute2, …)

SalesPerson:
SalesPerson(SalesID (PK), Name, Branch)

ProductSales:
ProductSales(SalesID (FK), Model (PK), SalesVol)

Manufacturer:
Manufacturer(Model (PK), ManufacturerName)

3
Worksheet 3 Normalisation
Unit 4 Exchanging data

(g) Identify the foreign key(s) in one of the tables.

SalesID (links to SalesPerson table)

You might also like