Académique Documents
Professionnel Documents
Culture Documents
RELATIONAL DATABASE
NORMALISATION
Problems in Relational Data Model
Anomalie
s
Information
Redundancy
Problems in Relational Data Model :
Anomalies
Anomali ●
Errors or inconsistence that may result
when a user attempts to update a table
that contains redundant data
3 types of anomalies ( modification,
es
●
The modification
Updat
●
anomaly occurs
when the record is
updated in the
relation. In this
anomaly, the
e
modification in the
value of specific
attribute requires
modification in all
records in which
that value occurs.
Update/Modification Anomalies
The Problem :
If we want to update Course_Name Computer Power 200 (Graphic & Multimedia) to Computer
Power 200 (Graphic) from STUDENT_COURSE table, we have to update all the rows of all
students who take that course. The problem is we have to update more than once.
STUDENT_COURSE
Student_ID Student_Name Address Course_Code Course_Name
S0144 Hamizah Mohamed Jln. Kg. Gajah ASDIM Associate Diploma in
Redzwan Interactive
Multimedia
S0149 Amjadi Abd. Mubin Bandar Baru CGMP200 Computer Power
Bangi 200 (Graphic and
Multimedia)
S0157 Nurazean Bt. Md. Tmn. Koperasi CITP100 Computer power
Sobri Polis 100 (IT)
S0159 Aidil Akmar Hj. Ayob Tmn. Melawati CGMP200 Computer Power
200 (Graphic and
Multimedia)
S0035 Syed Ahmad Rizal B. Jalan Puchong DIPCGR Diploma in
Syed Abdul Razak Computer Graphic
and Design.
Update/Modification Anomalies
The Solution :
Therefore, to avoid this problem, separate the STUDENT_COURSE table as follows :
STUDENT
Student_ID Student_Name Address Course_Code
S0144 Hamizah Mohamed Jln. Kg. Gajah ASDIM
Redzwan
S0149 Amjadi Abd. Mubin Bandar Baru Bangi CGMP200
S0157 Nurazean Bt. Md. Sobri Tmn. Koperasi Polis CITP100
S0159 Aidil Akmar Hj. Ayob Tmn. Melawati CGMP200
S0035 Syed Ahmad Rizal B. Syed Jalan Puchong DIPCGR
Abdul Razak
The process to update Course will occur once without affecting other records.
Insert Anomalies
Insert
●
The insertion anomaly occurs when a new record is inserted in the
relation. In this anomaly, the user cannot insert a fact about an
entity until he has an additional fact about another entity.
Insert Anomalies
The Problem :
If we want to insert a new Course_Code and Course_Name to the STUDENT_COURSE table, it is
necessary to enter no data (null) into the attribute for student (Student_ID, Student_Name,
Address). The problem is the primary key (Student_ID) cannot be null.
STUDENT_COURSE
Student_ID Student_name Address Course_Code Course_Name
S0144 Hamizah Mohamed Jln. Kg. Gajah ASDIM Associate Diploma in
Redzwan Interactive Multimedia
S0149 Amjadi Abd. Mubin Bandar Baru CGMP200 Computer Power 200
Bangi (Graphic and
Multimedia)
S0157 Nurazean Bt. Md. Sobri Tmn. Koperasi CITP100 Computer power 100
Polis (IT)
S0159 Aidil Akmar Hj. Ayob Tmn. Melawati DIPCGR Diploma in Computer
Graphic and Design
S0035 Syed Ahmad Rizal B. Jalan Puchong CGMP200 Computer Power 200
Syed Abdul Razak (Graphic and
Multimedia)
(null) (null) (null) (null) Diploma in Information
Technology
Insert Anomalies
The Solution :
Therefore, to avoid this problem, we have to separate the STUDENT_COURSE table as follows :
STUDENT
Student_ID Student_Name Address Course_Cide
S0144 Hamizah Mohamed Jln. Kg. Gajah ASDIM
Redzwan
S0149 Amjadi Abd. Mubin Bandar Baru Bangi CGMP200
S0157 Nurazean Bt. Md. Sobri Tmn. Koperasi Polis CITP100
S0159 Aidil Akmar Hj. Ayob Tmn. Melawati CGMP200
S0035 Syed Ahmad Rizal B. Jalan Puchong DIPCGR
Syed Abdul Razak
COURSE
Course_Code Course_Name
ASDIM Associate Diploma in Interactive Multimedia
CGMP200 Computer Power 200 (Graphic)
CITP100 Computer power 100 (IT)
DIPCGR Diploma in Computer Graphic and Design
CGMP200 Diploma in Information Technology
Any insertion to the COURSE table will not affect to the primary key in STUDENT table.
Delete Anomalies
STUDENT
Student_ID Student_Name Address Course_Code
S0144 Hamizah Mohamed Redzwan Jln. Kg. Gajah ASDIM
S0149 Amjadi Abd. Mubin Bandar Baru Bangi CGMP200
S0157 Nurazean Bt. Md. Sobri Tmn. Koperasi Polis CITP100
S0035 Syed Ahmad Rizal B. Syed Jalan Puchong CGMP200
Abdul Razak
COURSE
Course_Code Course_Name
ASDIM Associate Diploma in Interactive Multimedia
CGMP200 Computer Power 200 (Grafik)
CITP100 Computer power 100 (IT)
DIPCGR Diploma in Computer Graphic and Design
CGMP200 Diploma in Information Technology
Any deletion from STUDENT table will not affect the data in COURSE table.
Problems in Relational Data Model :
Information Redundancy
The Problem :
In the STUDENT_SUBJECT table there is redundant information. It shows that the details of subject
ADM101 (Internet Publishing) are repeated for every member of Student_ID enrolled for that subject.
Information Redundancy
The solution :
Therefore, to avoid this problem, we have to separate the STUDENT_SUBJECT table as follows :
STUDENT
Student_ID
Student_Name Address
S0144 Hamizah Mohamed Redzwan Jln. Kg. Gajah
ADM301 Project 4
STUDENT_SUBJECT
Student_ID Subject_Code It shows that the subject information
S0144 ACT410 appears only once for each subject in
SUBJECT relation & only the Subject_Code
S0149 ADM101 is repeated in the STUDENT_SUBJECT
S0157 ADM101 relation.
S0159 ADM301
S0035 ADM101
Normalization
U 1N 2N 3N
NF F F F
Identify functional dependencies
Functional Dependecies
Functional Dependencies
Functional dependencies
describe relationships
between attributes in a
relation
A relationship between
attributes in which one
attribute or group of
attribute determines the
value of another in the
same table
Transitive Dependencies
Transitive Dependencies
A Functional dependency
between 2 or more non-
key attributes
A condition in which an
attribute is dependent on
another attributes that is
not part of the primary key
A relation is in 3NF if it is in
2NF and has no transitive
dependencies
Non-primary key attribute
is functionally dependent
on another non-primary
key attribute
THE END