Data Types Homework 3 Relational databases and normalisation
Data Types Homework 3 Relational databases and normalisation
1. A boat hire company stores details of its customers, boats and rentals in a database. The
relations in the database hold the following data:
Boat (BoatName, type, length, berths)
Customer (CustomerID, Surname, Firstname, AddressLine1, AddressLine2, Town,
Postcode, DateOfBirth, email)
BoatHire (CustomerID, BoatName, HireDate, HireEndDate)
(a) The key in the BoatHire relation consists of three attributes.
What is the name given to a key made up of more than one attribute? [1]
Composite key
(c) State, with reasons, why it is important that relations in a database are in
Third Normal Form. [6]
Minimizes data redundancy: Ensures that no unnecessary duplication of data exists, which
reduces storage requirements.
Eliminates update anomalies: Prevents issues where updates to data in one place require
manual updates in multiple places.
Eliminates deletion anomalies: Prevents accidental loss of essential data when unrelated
data is deleted.
(d) Complete the Entity-Relationship diagram below to show the degree of the
relationships between the entities. [3]
1
Boat
BoatHire Customer
2. A database is to be created to hold data about students at a Sixth Form College and the
subjects they study.
Students study a number of subjects, and each subject has one subject leader.
The table below is a first attempt at the design of the database.
StudentID Name TutorGroup Tutor Subject Level SubjectLeader
History A AJH
S1000 Bella 2 CKE Geography A BJG
Economics AS CKE
English AS DRE
S2000 Jane 3 KPR French A FJF
Russian A KPR
English A DRE
S3000 Greg 1 DRE
Geography A BJG
(a) Explain, with reference to the data, why the table is not in First Normal Form (1NF). [2]
The table is not in 1NF because it contains multi-valued attributes (e.g., multiple
subjects, levels, and subject leaders stored in a single row for a student). This violates
the rule that each cell must contain a single value.
(d) The two tables Student and StudentSubject are related. Explain how this is achieved
using a primary and a foreign key. [2]
(e) Explain why the table StudentSubject is not in Second Normal Form (2NF). [2]
(f) Explain why the table Student is not in Third Normal Form (3NF) [2]
[Total 25 Marks]