Tutorial Normalization - Part 2 (Q)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

WIA2001/WIB2001

DATABASE
SEM 1, 2021/2022
Tutorial 8 : Normalization – Revision

Question 1

ISBN BookTitle Publicatio Cost Categ Publisher AuthorID AuthorName


n_Date ory
88431721 Database 04-June- 99.40 Comp American C001 T. Peterson
13 Implementation 2017 uter Publishing C002 J. Austin
C003 W. White
19157624 Handcranked 21-Jul- 87.80 Comp American C003 W. White
92 Computers 2017 uter Publishing C004 L. White

From the above table, do a normalization process from 1NF to 3NF. Express your answers in the following
format:

Eg : TableName(column1, column2, column3, …, columnm)


1NF
2NF, 3NF
Book(ISBN, BookTitle, Cost, Category)
Author(AuthorID, AuthorName)
Publication(ISBN, AuthorID,PublicationDate, Publisher)

Question 2

Student StudentNa Major GradHou CourseI CourseNa CreditHo Grad


ID me rs D me ur e
P1050 Azura Ali Computer 118 CS001 Intro to 3 A
Science Programmi
ng
P1050 Azura Ali Computer 118 CS002 Info 3 A
Science Systems
P1050 Azura Ali Computer 118 CS003 C++ Lab 2 B
Science
L2115 Kenny Informatio 110 IT001 Into to Info 3 A
Chong n Systems
Technolo and
gy Technolog
y
L2115 Kenny Informatio 110 IT002 Intro to DB 3 B
Chong n
Technolo
gy
L4211 Ahmad Computer 118 CS002 Info 3 A
Ismail Science Systems
L4211 Ahmad Computer 118 CS004 Web 3 B
Ismail Science Programmi
ng
L3457 S. Rajoo Software 120 CS003 C++ Lab 2 B
Engineeri
ng

a) What is the primary key for the table shown above?

StudentID, CourseID

b) Explain why this table is not in 2NF? Illustrate your explanations by using appropriate examples from
the table.

1. The table is not in 1NF


-The primary key hasn’t identified.
2. There are partial dependencies that haven’t been eliminated.
-For example, StudentID has partial dependencies on the StudentName and Major.
c) Normalize the table into 2NF. Show your answer in schema format ie. TABLENAME(key, attibute….)

Student(StudentID, StudentName, Major, GradHours)


Course(CourseID, CourseName, CreditHour)
Evaluation(StudentID,CourseID, Grade)

d) What is the condition for a table to be in 3NF? Normalize the table into 3NF. Explain your normalization
process using appropriate examples from the table. Show your answer in schema format ie.
TABLENAME(key, attibute….)
Conditions for a table to be in 3NF:
1. Already in 2NF
2. There is no transitive dependency

To achieve 3NF, we have to eliminate the transitive dependency. In the tables, there is a partial dependency
exist between Major and GradHours. Therefore, we have to form one more table by using the Major as the key
of table as follow:

Major(Major, GradHours)

e) If the original table shown above is not normalized, what anomalies exists for the table? Name and
explain each of the anomaly and provide suitable examples using the data given in the table.

Insertion anomalies. If only this file exists, to add a new course, one dummy student data have to be inserted to
reflect the course’s condition.
Update anomalies. If the student Azura Ali has a new StudentID, the new StudentID has to be entered in each
of the file record in which the Azura Ali’s StudentID is shown.
Deletion anomalies. If the student Azura Ali and the student Ahmad Ismail are deleted, the InfoSystems will be
deleted as well.

You might also like