Beruflich Dokumente
Kultur Dokumente
NORMALISATION
NORMALISATION
F4109: DATABASE SYSTEM
Objektif
Mentakrif Relation
Mengenal pasti masalah dalam relational data model.
Mentakrif penormalan dan tahap penormalan.
Mengenal pasti langkah-langkah penormalan.
Objective
Define relation.
Recognize problems in relational data model.
Define normalization and the level of normalization.
Identify the step in normalization.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
RELATION adalah satu jadual 2 dimensi yang mempunyai lajur dan baris.
Contoh / Example :
PUBLISHER
Publisher_Code Name City
F-B1 Fajar Bakti Malaysia Baris
(Row / Tuple)
M-G1 McGraw Hill UK
P-H1 Prentice Hall UK
T-H1 Thompson Learning US
Kunci Primer / Primary Key Atribut Bukan Kunci / Non-primary key (Non key attribute)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Skema hubungan adalah senarai atribut yang terkandung dalam hubungan tersebut. / A
relation scheme is a list of attributes and their corresponding domains.
Daripada contoh di atas, anda boleh mengenal pasti / From the example, we can identify:
Oleh itu skema hubungan ialah / The relation schema will be like this:
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh / Example : Berikut adalah contoh table bagi pangkalan data E-Book / Below are the example of
table in E-Book database.
PUBLISHER
Publisher_Code Name City
F-B1 Fajar Bakti Malaysia
M-G1 McGraw Hill UK
P-H1 Prentice Hall UK
T-H1 Thompson Learning US
AUTHOR BOOK_AUTHOR
Author_No Author_Name Book_Code Author_No
A001 Ruth Maran P01 A006
A002 McFadden P02 A001
A003 Kaufeld John P03 A002
A004 Curtis Frye P04 A003
A005 Joe Adamski P05 A004
A006 Kroenke P06 A008
A007 Pratt Philip J. P07 A005
A008 Mardiana, Hasnah
A009 Harrington, T
A010 Connolly, T
BOOK
Book
Book_Title Publisher_Code Description Type Price Book_Sample Book_Cover
Code
P01 Access 2000 Processing M-G1 Database 76.00 Yes
** Dalam skema hubungan, atribut kunci asing akan ditandakan dengan garis . / In relation schema, foreign
key attribute will be mark with this line .
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Jenis-jenis Anomali:
(i) Anomali Pengubahsuaian
(ii) Anomali penambahan
(iii) Anomali penghapusan
(a) Anomalies
Anomalies - Errors or inconsistencies that may result when a user attempts to update
a table that contains redundant data.
Types of anomalies:
(i) Modification Anomalies
(ii) Insert Anomalies
(iii) Delete Anomalies
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
a) Anomali Pengemaskinian
PELAJAR_KURSUS
No_Pelajar Nama_pelajar Alamat Kod_kursus Nama_kursus
Masalah :
Sekiranya pengguna ingin menukar Nama_kursus Computer Power 200 (Graphic and Multimedia)
kepada Computer Power 200 (Graphic) daripada jadual PELAJAR_KURSUS, maka, perubahan perlu di
lakukan pada setiap baris yang mempunyai Nama Kursus Computer Power 200 (Graphic and
Multimedia) . Masalah yang dihadapi ialah pengguna perlu membuat perubahan lebih daripada sekali.
a) Update Anomalies
i) Modification Anomalies
STUDENT_COURSE
Student_ID Student_Name Address Course_Code Course_Name
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.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian :
Bagi menyelesaikan masalah ini, pengguna harus mengasingkan relation PELAJAR_KURSUS seperti
berikut:
PELAJAR
No_pelajar Nama_pelajar Alamat Kod_kursus
KURSUS
Kod_kursus Nama_kursus
Proses pengubahsuaian akan berlaku sekali sahaja tanpa melibatkan rekod yang lain.
The Solution :
Therefore, to avoid this problem, we have to separate the STUDENT_COURSE table as follows :
STUDENT
Student_ID Student_Name Address Course_Code
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
The process to update Course will occur once without affecting other records.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PELAJAR_KURSUS
No_Pelajar Nama_pelajar Alamat Kod_kursus Nama_kursus
Masalah :
Sekiranya pengguna ingin menambah Kod_kursus dan Nama_kursus yang baru ke dalam jadual
PELAJAR_KURSUS, field No_pelajar, Nama_pelajar, alamat akan mempunyai nilai null (tiada data).
Masalah yang dihadapi ialah Kunci Primer (No_pelajar) tidak boleh mempunyai nilai null.
STUDENT_COURSE
Student_ID Student_name Address Course_Code Course_Name
The Problem :
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian:
Bagi menyelesaikan masalah ini, pengguna harus mengasingkan jadual PELAJAR_KURSUS seperti
berikut:
PELAJAR
KURSUS
Kod_kursus Nama_kursus
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
Mana-mana penambahan tidak akan mempengaruhi Kunci Primer (primary key) dalam relation
PELAJAR.
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 Redzwan Jln. Kg. Gajah ASDIM
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
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.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PELAJAR_KURSUS
No_Pelajar Nama_pelajar Alamat Kod_kursus Nama_kursus
Masalah :
Apabila maklumat pelajar Aidil Akmar Hj. Ayob dihapuskan daripada relation PELAJAR_KURSUS,
secara tidak langsung, maklumat mengenai Kursus DIPCGR (Diploma in Computer Graphic and
Design) juga akan terhapus. Ini bermakna tidak ada lagi kursus DIPCGR di dalam pangkalan data.
STUDENT_COURSE
Student_ID Student_Name Address Course_Code Course_Name
The Problem :
When the Student_ID S0035 is deleted from STUDENT_COURSE table, information about any
Course_Code DIPCGR related to that student will also be deleted. That means no other Course_Code
DIPCGR remains in the database.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian:
Bagi menyelesaikan masalah ini, pengguna harus mengasingkan jadual PELAJAR_KURSUS seperti
berikut:
PELAJAR
No_Pelajar Nama_pelajar Alamat Kod_kursus
KURSUS
Kod_kursus Nama_kursus
Mana-mana penghapusan data daripada relation PELAJAR tidak akan melibatkan data dalam relation
KURSUS
The Solution :
Therefore, to avoid this problem, we have to separate the STUDENT_COURSE table as follows :
STUDENT
Student_ID Student_Name Address Course_Code
COURSE
Course_Code Course_Name
Any deletion from STUDENT table will not affect the data in COURSE table.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PELAJAR_SUBJEK
NoPelajar Nama_pelajar Alamat Kod Subjek Nama Subjek Jam Kredit
Masalah :
Di dalam jadual PELAJAR_SUBJEK terdapat maklumat yang bertindan. Jadual di atas menunjukkan
data mengenai Subjek di simpan berulang kali. Akibatnya, ia merugikan ruang storan.
STUDENT_SUBJECT
Student_ID Student_Name Address Subject_Code Subject_Name Credit_Hours
S0144 Hamizah Mohamed Jln. Kg. Gajah ACT410 Computerised 4
Redzwan Accounting
S0149 Amjadi Abd. Mubin Bandar Baru ADM101 Internet 4
Bangi Publishing
S0157 Nurazean Bt. Md. Tmn. Koperasi ADM101 Internet 4
Sobri Polis Publishing
S0159 Aidil Akmar Hj. Tmn. Melawati ADM301 Project 4
Ayob
S0035 Syed Ahmad Rizal Jalan Puchong ADM101 Internet 4
B. Syed Abdul Publishing
Razak
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.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian :
The solution :
Therefore, to avoid this problem, we have to separate the STUDENT_SUBJECT table as follows :
It shows that the subject information appears only once for each
subject in SUBJECT relation & only the Subject_Code is
repeated in the STUDENT_SUBJECT relation.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penormalan (Normalisation)
Satu proses untuk menempatkan atribut ke dalam jadual bagi mengelakkan masalah anomali dan
pertindanan data yang akan menyebabkan pangkalan data yang tidak stabil (Unnormalised).
3.2 Normalisation
Normalisation
A process for assigning attributes into table and reduces data redundancy and helps eliminate the data
anomalies that associated with poor database design (unnormalised).
Tujuan Penormalan:
Bagi memastikan pengemaskinian anomali (penambahan, penghapusan, pengubahsuaian)
tidak berlaku.
Untuk mengurangkan pengulangan data atau storan.
Memudahkan proses pencarian rekod.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 1 / Example 1:
Jadual di bawah menunjukkan medan Subject_name, Subject_code, Credit_hour, dan Grade mengandungi nilai
berulang.
The table below shows that Subject_name, Subject_code, Credit_hour and Grade fields which contains multiple or
more repeating values.
STUDENT
Stud_ID Stud_ Subject_Name Subject_Code Credit_ Grade Addr. Course Coor-
Name Hour dinator
S0001 Azlina Ahmad Computerised ACT410 4 A Sentul Dip. in Fazilah
Accounting Information
Internet Publishing ADM101 4 B Technology
Graphic Design ART210 4 C
Application
S0144 Amirul Hamdan Graphic ART310 4 A Shah Dip. in Ahmad
Communication Alam Computer
Introduction to ART230 2 B Graphic
Graphic Design Design
Business BUS210 4 B
Organization
S0151 Maslina Yakub Promotion Design ART410 4 C Shah Associate Sahada
Graphic Design ART 210 4 A Alam Dip. in
Application Interactive
Business BUS210 4 A Multimedia
Organisation
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 1 / Example 1:
Jadual yang telah dinormalkan (Normalised Form) / Normalised Form
STUDENT
Stud_ID Stud_Name Address Course
S0001 Azlina Ahmad Sentul Diploma in Information Technology
S0144 Amirul Hamdan Shah Alam Diploma in Computer Graphic Design
S0151 Maslina Yakub Shah Alam Associate Diploma in Interactive Multimedia
STUDENT (Stud_ID, Stud_Name, Address, Course)
SUBJECT
Subject_Code Subject_Name Credit_Hours
ACT410 Computerised Accounting, 4
ART310 Graphic Communication 4
ART410 Promotion Design 4
ART230 Introduction to graphic Design 2
BUS210 Business Organization 4
QDM101 Internet Publishing 4
ART210 Graphic Design Application 4
SUBJECT (Subject_Code, Subject_Name, Credit_hour_)
STUDENT_GRADE
Student_ID Subject_Code Grade
S0001 ACT410 A
S0001 ADM101 B
S0001 ART210 C
S0144 ART310 A
S0144 ART230 B
S0144 BUS210 B
S0151 ART410 C
S0151 ART 210 A
S0151 BUS210 A
STUDENT_GRADE (Student_ID, Subject_Code, Grade)
COURSE
Course Coordinator
Diploma in Information Technology Fazilah
Diploma in Computer Graphic Design Ahmad
Associate Diploma in Interactive Multimedia Sahada
COURSE (Course, Coordinator)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 2 / Example 2:
Jadual di bawah menunjukkan medan Item_Code, Item_Desc, Qty, Price, Supplier dan Supplier_Address
mengandungi nilai berulang (Repeating groups).
The table below shows that Item_code, Item_desc, Qty, Price, Supplier & Supplier_address fields contain
multiple or more repeating values.
INVOICE
Cust_No Cust_Name Address Item_Code Item_desc Qty Price Supplier Supp_
Address
A100 Abu Sentul KB100 Keyboard 20 25 XYZ Ent P. Jaya
CP200 CPU 10 650 XYZ Ent P. Jaya
MS112 Mouse 2 15 XYZ Ent. P. Jaya
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 2 / Example 2:
Jadual Normalised / Normalised Form
CUSTOMER
Cust_No Cust_Name Address
INVOICE
Cust_No Item_Code Qty
A100 KB100 20
A100 CP200 10
A100 MS112 2
A101 HD200 10
A101 KB100 10
A101 SP360 5
A102 MS112 4
A102 CP200 2
A102 VG400 2
INVOICE (Cust_No, Item_Code, Qty)
ITEM
Item_Code Item_desc Price Supplier
SUPPLIER
Supplier Supplier_address
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Bentuk
BentukNormal
NormalPertama
Pertama(BN1)
(BN1)(First
(First Normal Form
Normal Form (1NF)) (1NF))
Kenal pasti Kesandaran
Fungsian
Bentuk Normal Kedua (BN2) (Second
Normal Form (2NF))
Hapuskan
Bentuk Normal Ketiga (BN3) kesandaran
Transitif
(Third Normal Form (3NF))
Identify Functional
Dependencies
Second Normal Form (2NF)
Remove Transitive
Third Normal Form (3NF) Dependencies
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 1:
Langkah-Langkah Penormalan
Example 1:
Steps in Normalisation
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STUDENT
Student ID Student Subject Name Subject Credit Grade Address Course Coordinator
Name Code Hours
S0001 Azlina Computerised ACT410 4 A Sentul Diploma in Fazilah
Ahmad Accounting Information
Internet ADM101 4 B Technology
Publishing 4
Graphic Design ART210 C
Application
S0144 Amirul Graphic ART310 4 A Shah Alam Diploma in Ahmad
Hamdan Communication Computer
Introduction to ART230 2 B Graphic
graphic Design Design
Business BUS210 4 B
Organization
STUDENT (Student_ID, Student_name, Subject_name , Subject_code, Credit_hour, Grade, Address, Course, Coordinator)
Terdapat banyak nilai di dalam satu baris di dalam lajur Nama_subjek, kod_subjek, jam_kredit dan gred.
The table above shows that Subject_name, Subject_code, Credit_hour and Grade fields which contains multiple
or more repeating values.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STUDENT
Student ID Student Subject Grade Address Course Coordinator
Name code
S0001 Azlina Ahmad ACT410 A Sentul Diploma in Information Fazilah
Technology
S0001 Azlina Ahmad ADM101 B Sentul Diploma in Information Fazilah
Technology
S0001 Azlina Ahmad ART210 C Sentul Diploma in Information Fazilah
Technology
S0144 Amirul ART310 A Shah Alam Diploma in Computer Ahmad
Hamdan Graphic Design
S0144 Amirul ART230 B Shah Alam Diploma in Computer Ahmad
Hamdan Graphic Design
S0144 Amirul BUS210 B Shah Alam Diploma in Computer Ahmad
Hamdan Graphic Design
S0151 Mazlina ART410 C Shah Alam Associate Diploma in Sahada
Yakub Interactive Multimedia
S0151 Mazlina ART 210 A Shah Alam Associate Diploma in Sahada
Yakub Interactive Multimedia
S0151 Mazlina BUS210 A Shah Alam Associate Diploma in Sahada
Yakub Interactive Multimedia
SUBJECT
Subject_Code Subject_Name Credit_hour
ACT410 Computerised Accounting 4
QDM101 Internet Publishing 4
ART210 Graphic Design Application 4
ART310 Graphic Communication 4
ART230 Introduction to graphic Design 2
BUS210 Business Organization. 4
ART410 Promotion Design 4
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Nota 1.2 :
Kesandaran Fungsian
Kesandaran fungsian menjelaskan tentang perhubungan di antara atribut di dalam relation.
Kesandaran fungsian adalah hubungan di antara atribut di mana satu atau sekumpulan atribut boleh mengenal
pasti atribut lain dalam table yang sama.
Contoh:
Mikrokomputer di dalam makmal Komputer Cosmopoint mempunyai satu saiz ingatan komputer (MemorySize)
yang utama. Jadi, saiz ingatan komputer (MemorySize) adalah bergantung sepenuhnya kepada
Computerserialnumber.
Cara menulis:
Computerserialnumber MemorySize
Atribut di sebelah kiri dipanggil penentu (determinants).
Cara membaca:
“Computerserialnumber menentukan fungsian IngatanKomputer”
atau
“Computerserialnumber menentukan MemorySize”
atau
“MemorySize adalah bergantung sepenuhnya kepada Computerserialnumber”
Note 1.2 :
What is 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.
Example :
Consider microcomputers in a COSMOPOINT computer lab. Each has only one size of main memory. So
MemorySize is functionally dependent on ComputerSerialNumber.
How to write?
ComputerSerialNumber MemorySize
The attributes on the left side of the arrow are called determinants.
How to read?
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Tiga kesandaran fungsian di atas ia akan membentuk tiga relations di dalam Bentuk Normal Kedua (2NF) .
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STUDENT
Student_ID Student_name Address Course Coordinator
S0001 Azlina Ahmad Sentul Diploma in Information Technology Fazilah
S0144 Amirul Hamdan Shah Diploma in Computer Graphic Design Ahmad
Alam
S0151 Mazlina Yakub Shah Associate Diploma in Interactive Sahada
Alam Multimedia
STUDENT (Student_ID, Student_name, Address, Course, Coordinator)
SUBJECT
Subject_code Subject_name Credit_hour
ACT410 Computerised Accounting 4
QDM101 Internet Publishing 4
ART210 graphic Design Application 4
ART310 Graphic Communication 4
ART230 Introduction to graphic Design 2
BUS210 Business Organization. 4
ART410 Promotion Design 4
Subject (Subject_code, Subject_name, Credit_hour)
STUDENT_GRADE
Student_ID Subject_code Grade
S0001 ACT410 A
S0001 QDM101 B
S0001 ART210 C
S0144 ART310 A
S0144 ART230 B
S0144 BUS210 B
S0151 ART410 C
S0151 ART210 A
S0151 BUS210 A
STUDENT_GRADE (Student_ID, Subject_code, Grade)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Nota 1.3:
Kesandaran fungsian di antara 2 atau lebih atribut bukan kunci (non key attribute). Satu keadaan di mana
atribut bergantung kepada atribut bukan kunci (non primary key) yang lain.
Satu hubungan berada dalam Bentuk Normal Ketiga (3NF) sekiranya hubungan itu berada dalam bentuk
normal kedua (2NF) dan tidak ada kesandaran transitif.
Atribut bukan kunci primer (non primary key) bergantung kepada atribut bukan kunci primer yang lain.
Note1.3:
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian: untuk membangunkan Jadual Bentuk Normal ketiga (3NF), anda dikehendaki
menghapuskan kesandaran transitif.
Solution : In order to build 3NF table (relation), you have to remove the transitive dependencies.
Hasil / Becomes
Oleh itu, terdapat 4 jadual dalam bentuk normal ketiga (3NF) seperti yang ditunjukkan di bawah:
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STUDENT
Student_ID Student_name Address Course
S0001 Azlina Ahmad Sentul Diploma in Information Technology
S0144 Amirul Hamdan Shah Alam Diploma in Computer Graphic Design
S0151 Mazlina Yakub Shah Alam Associate Diploma in Interactive Multimedia
STUDENT (Student_ID, Student_name, Address,Course)
SUBJECT
Subject_code Subject_name Credit_hour
ACT410 Computerised Accounting, 4
ART310 Graphic Communication 4
ART410 Promotion Design 4
ART230 Introduction to graphic Design 2
BUS210 Business Organization 4
QDM101 Internet Publishing 4
ART210 Graphic Design Application 4
SUBJECT(Subject_code, Subject_name, Credit_hour)
COURSE
Course Coordinator
Diploma in Information Technology Fazilah
Diploma in Computer Graphic Design Ahmad
Associate Diploma in Interactive Multimedia Sahada
COURSE (Course, Coordinator)
STUDENT_GRADE
Student_ID Subject_code Grade
S0001 ACT410 A
S0001 ADM101 B
S0001 ART210 C
S0144 ART310 A
S0144 ART230 B
S0144 BUS210 B
S0151 ART410 C
S0151 ART 210 A
S0151 BUS210 A
STUDENT_GRADE (Student_ID, Subject_code, Grade)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 2 :
Langkah-Langkah Penormalan
Example 2 :
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
INVOICE
Customers Customer Address Item Item Qty Price Supplier Supplier
no name code desc _Address
A100 Abu Sentul KB100 Keyboard 20 25 XYZ Ent Petaling Jaya
CP200 CPU 10 650 XYZ Ent Petaling Jaya
MS112 Mouse 2 15 XYZ Ent. Petaling Jaya
A101 Salmah Ampang HD200 Hard Disk 10 100 Seagate Pulau Pinang
KB100 Keyboard 10 25 XYZ Ent Petaling Jaya
SP360 Speaker 5 45 XYZ Ent Petaling Jaya
Jadual di atas menunjukkan Kod_item, Item_desc, Qty, Harga, Pembekal dan Alamat_Pembekal adalah medan
yang mengandungi data yang berulang (repeating value).
Andaian : Satu pembekal boleh membekalkan lebih daripada satu item
The table above shows that Item_code, Item_desc, Qty, Price, Supplier & Supplier_address fields contain
multiple or repeating values.
Assumption : One supplier supply many products.
Masalah Kumpulan data berulang boleh di The repeating group can be handled by
separating Unnormalised Form (UNF) into
atasi dengan menukarkan Unnormalised Form
First Normal Form (1NF) as shown later.
(UNF) kepada First Normal Form (1NF).
(Seperti jadual di bawah)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
CUSTOMER
Customer_no Customer_name Address
A100 Abu Sentul
A101 Salmah Ampang
A102 Rani Ampang
CUSTOMER (Customer_No,Customer_name,Address)
INVOICE
Customer_no Item_code Item_desc Qty Price Supplier Supplier_address
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Kesandaran Fungsian
Kesandaran fungsian menjelaskan tentang perhubungan di antara atribut di dalam relation.
Kesandaran fungsian adalah hubungan di antara atribut di mana satu atau sekumpulan atribut boleh mengenal
pasti atribut lain dalam table yang sama.
A relationship between attributes in which one attribute or group of attribute determines the value of another in
the same table.
Berdasarkan kepada 3 kesandaran fungsian di atas, terdapat 3 jadual (relation) dalam bentuk normal
kedua (2NF).
Based on these 3 functional dependencies, there will be 3 tables (relations) in 2NF.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
CUSTOMER
Customer_no Customer_name Address
A100 Abu Sentul
A101 Salmah Ampang
A102 Rani Ampang
CUSTOMER (Customer_no, Customer_name, Address)
ITEM
Item_code Item_desc Price Supplier Supplier_Address
INVOICE
Customer_no Item_code Qty
A100 KB100 20
A100 CP200 10
A100 MS112 2
A101 HD200 10
A101 KB100 10
A101 SP360 5
A102 MS112 4
A102 CP200 2
A102 VG400 2
INVOICE (Customer_no, Item_code, Qty)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Nota 2.3:
Nota 2.3:
Transitive Dependency
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 Third Normal Form (3NF) if it is in 2NF and has no transitive dependency.
Non-primary key attribute is functionally dependent on another non-primary key attribute.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian: Untuk membangunkan Jadual Bentuk Normal ketiga (3NF), anda dikehendaki menghapuskan
kesandaran transitif.
Solution: In order to build 3NF table (relation), you have to remove the transitive dependencies.
Hasil / Becomes
Oleh itu, terdapat 4 jadual dalam bentuk normal ketiga (3NF) seperti yang ditunjukkan di bawah:
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
CUSTOMER
Customer_no Customer_name Address
A100 Abu Sentul
A101 Salmah Ampang
A102 Rani Ampang
CUSTOMER (Customer_no, Customer_name, Address)
INVOICE
Customer_no Item_code Qty
A100 KB100 20
A100 CP200 10
A100 MS112 2
A101 HD200 10
A101 SP360 5
A101 KB100 10
A102 MS112 4
A102 CP200 2
A102 VG400 2
INVOICE (Customer_no, Item_code, Qty)
ITEM
Item_code Item_desc Price Supplier
SUPPLIER
Supplier Supplier_address
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 3:
Langkah-Langkah Penormalan
Example 3 :
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PROJECT
Project_no Project_name Staff_no Staff_name Job_classification Charge_hour Hour
Jadual di atas menunjukkan Staff_no, Staff_name, Job_classification, Charge_hour dan Hour adalah field yang
mengandungi data yang berulang (repeating value).
The above table shows fields (Staff_no, Staff_name, Job_classification, Charge_hour & Hour) which have
Repeating Values.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PROJECT
Project_no Project_ Staff_no Staff_name Job_ Charge_ hour
name classification hour
1 DADD 00689 Samat Elect.Engineer RM 20 20
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Kesandaran fungsian adalah hubungan di antara atribut di mana satu atau sekumpulan atribut boleh mengenal
pasti atribut lain dalam table yang sama.
A relationship between attributes in which one attribute or group of attribute determines the value of another in
the same table.
Project_no Project_name
Staff_no Staff_name, Job_classification, Charge_hour
Staff_no, Project_no Hour
Berdasarkan kepada 3 kesandaran fungsian di atas, terdapat 3 jadual (relation) dalam bentuk normal kedua
(2NF).
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PROJECT
Project_no Project_name
1 DADD
2 Programming
3 Multimedia
PROJECT (Project_no, Project_name)
STAFF
Staff_no Staff_name Job_classification Charge_hour
HOUR
Staff_no Project_no Hour
00689 1 20
00500 1 18
00444 1 15
00123 2 30
00999 2 56
00689 3 40
00111 3 35
HOUR (Staff_no, Project_no, Hour)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Nota 3.3:
Note 3.3:
Transitive Dependency
A functional dependency between 2 or more non-key attributes. A condition in which an attribute is
dependent on another attribute that is not part of the primary key.
A relation is in Third Normal Form (3NF) if it is in 2NF and has no transitive dependency.
Non-primary key attribute is functionally dependent on another non-primary key attribute.
Project_no Project_name
Staff_no Staff_name, Job_classification, Charge_hour
Staff_no, Project_no Hour
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Penyelesaian: untuk membangunkan Jadual Bentuk Normal ketiga (3NF), anda dikehendaki menghapuskan
kesandaran transitif.
Solution: In order to build 3NF table (relation), you have to remove the transitive dependencies.
Becomes
Oleh itu, terdapat 4 jadual dalam bentuk normal ketiga (3NF) seperti yang ditunjukkan di bawah:
So, there will be 4 tables in 3NF as shown below:
Project_no Project_name
Staff_no, Project_no Hour
Staff_no Staff_name, Job_classification
Job_classification Charge_hour
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
PROJECT
Project_no Project_name
1 DADD
2 Programming
3 Multimedia
PROJECT (Project_no, Project_name)
STAFF
Staff_no Staff_name Job_classification
HOUR
Staff_no Project_no Hour
00689 1 20
00500 1 18
00444 1 15
00123 2 30
00999 2 56
00689 3 40
00111 3 35
HOUR (Staff_no, Project_no, Hour)
JOB
Job_classification Charge_hour
Elect.Engineer RM 20
Web Developer RM 22
System Analyst RM 25
Technical Support RM 16
Programmer RM 18
JOB (Job_classification, Charge_hour)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 4 / Example 4:
Berdasarkan rajah di bawah, normalkan sehingga peringkat ketiga (UNF – 3NF). Normalised the table below from
UNF to 3NF.
140 Alan Beeton Accounting 52000 103 Tax Acc 8 Dec 2003
110 Chris Lucera Info Systems 43000 101 SPSS 1 Dec 2003
104 C++ 14 Nov 2003
190 Lorenzo Davis Finance 55000
150 Susan Martin Marketing 42000 101 SPSS 16 Jun 2003
105 Java 12 Aug 2003
UNF
Jadual dalam UNF mempunyai data yang berulang dan ianya perlu ditukarkan ke 1NF . / Table in UNF consist of
redundant data and it must be transform to 1NF.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STAFF
StaffID Name Dept Salary
100 Margaret Simpson Marketing 48000
110 Chris Lucera Info Systems 43000
140 Alan Beeton Accounting 52000
190 Lorenzo Davis Finance 55000
150 Susan Martin Marketing 42000
STAFF ( StaffID, Name, Dept, Salary)
COURSE
StaffID CourseID CourseTitle EndDate
100 101 SPSS 19 Jul 2003
100 102 Surveys 10 Aug 2003
110 101 SPSS 1 Dec 2003
110 104 C++ 14 Nov 2003
140 103 Tax Acc 8 Dec 2003
190
150 101 SPSS 16 Jun 2003
150 105 Java 12 Aug 2003
COURSE (StaffID, CourseID, CourseTitle, EndDate)
Jadual 1NF adalah keadaan di mana setiap atributnya tidak mengandungi nilai yang berulang (satu nilai sahaja). /
Table in 1NF is the situation where the intersection of each row and column contains no repeating values (only
one value).
Jadual 1NF perlu ditukar ke 2NF dengan mengenal pasti kesandaran fungsian . / Table in 1NF must be transform
to 2NF by identify the functional dependencies.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Kesandaran Fungsian
Kesandaran fungsian menjelaskan tentang perhubungan di antara atribut di dalam relation.
Kesandaran fungsian adalah hubungan di antara atribut di mana satu atau sekumpulan atribut boleh mengenal
pasti atribut lain dalam table yang sama.
A relationship between attributes in which one attribute or group of attribute determines the value of another in
the same table.
Berdasarkan kepada kesandaran fungsian di atas, terdapat 3 jadual (relation) dalam bentuk normal kedua (2NF).
Based on these 3 functional dependencies, there will be 3 tables (relations) in 2NF.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
STAFF
StaffID Name Dept Salary
100 Margaret Simpson Marketing 48000
110 Chris Lucera Info Systems 43000
140 Alan Beeton Accounting 52000
190 Lorenzo Davis Finance 55000
150 Susan Martin Marketing 42000
STAFF ( StaffID, Name, Dept, Salary)
STAFFCOURSE
StaffID CourseID EndDate
100 101 19 Jul 2003
100 102 10 Aug 2003
110 101 1 Dec 2003
110 104 14 Nov 2003
140 103 8 Dec 2003
190
150 101 16 Jun 2003
150 105 12 Aug 2003
COURSE (StaffID, CourseID, EndDate)
COURSE
CourseID CourseTitle
101 SPSS
102 Surveys
101 SPSS
104 C++
103 Tax Acc
101 SPSS
105 Java
COURSE (CourseID, CourseTitle)
Jadual 2NF perlu ditukar ke 3NF dengan mengenal pasti kesandaran transitif . / Table in 1NF must be transform to
2NF by identify the transitive dependency.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Transitive Dependency
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 Third Normal Form (3NF) if it is in 2NF and has no transitive dependency.
Non-primary key attribute is functionally dependent on another non-primary key attribute.
CourseID CourseTitle
Tidak ada kesandaran transitif dalam relation tersebut / There is no transitive dependencies in the relation.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 5: / Example 5:
Normalkan borang di bawah sehingga ke tahap penormalan ke tiga (3NF). Berikan jawapan anda dalam bentuk
skema hubungan.
Normalise the following form to Third Normal Form (3NF). You are required to show the normalisation steps
taken. Provide your answer in a relation scheme.
NZ SDN. BHD
RECEIPT OF HOUSE RENTAL PAYMENT
Penyelesaian:
Langkah-langkah:
Berikan nama hubungan (relation) yang sesuai.
Senaraikan semua atribut yang terdapat di dalam borang tersebut.
Solution:
The Steps in Normalisation:
Name the appropriate relation name.
List down all attributes involved.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Skema hubungan dalam Bentuk Tidak Normal (UNF): / Relation scheme in an Unnormalised Form :
CUSTOMER(Tenant_code, Tenant_name)
CUSTOMER(Tenant_code, Tenant_name)
CUSTOMER(Tenant_code, Tenant_name)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
CUSTOMER(Tenant_code, Tenant_name)
CUSTOMER(Tenant_code, Tenant_name)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 6 / Example 6 :
Normalkan borang di bawah sehingga ke tahap penormalan ke tiga (3NF). /Normalise the following form to Third
Normal Form (3NF).
KOLEJ MILENNIUM
GRADE REPORT
SEMESTER MAY – AUGUST 2002
Penyelesaian:
Langkah-langkah:
Berikan nama hubungan (relation) yang sesuai.
Senaraikan semua atribut yang terdapat di dalam borang tersebut.
Solution:
The Steps in Normalisation:
Name the appropriate relation name.
List down all attributes involved.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Skema hubungan dalam Bentuk Tidak Normal (UNF): / Relation scheme in an Unnormalised Form :
STUDENT (Name, StudentNo, Address, Major, Status, Subject Code, SubjectName, Professor, ProfDept, Grade, Semester)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Contoh 7 / Example 7 :
Normalkan borang di bawah sehingga ke tahap penormalan ke tiga (3NF). /Normalise the following form to Third
Normal Form (3NF).
AR SDN BHD
32, JALAN KELANA,
50567 PETALING JAYA,
SELANGOR DARUL EHSAN
NO TEL : 03-7552525
Penyelesaian:
Langkah-langkah:
Berikan nama hubungan (relation) yang sesuai.
Senaraikan semua atribut yang terdapat di dalam borang tersebut.
Solution:
The Steps in Normalisation:
Name the appropriate relation name.
List down all attributes involved.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Skema hubungan dalam Bentuk Tidak Normal (UNF): / Relation scheme in an Unnormalised Form :
INVOICE (InvoiceNo, Date, CustomerNo, Name, Address, TelNo, ProductCode, ProductName, PriceUnit, Quantity,
Discount, Subtotal)
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
RELATION adalah satu jadual 2 dimensi yang mempunyai lajur dan baris.
Skema hubungan adalah senarai atribut yang terkandung dalam hubungan (relation).
Anomali adalah ralat yang mungkin berlaku apabila pengguna ingin mengemas kini jadual
yang mengandungi data yang berulang.
Penormalan adalah satu proses untuk menempatkan atribut ke dalam jadual bagi
mengelakkan masalah anomali dan pertindanan maklumat.
3 tahap penormalan :
1 NF
2 NF
3 NF
1 NF adalah satu relation di mana setiap atribut tidak mengandungi nilai yang berulang.
2 NF adalah satu relation dalam 1 NF dan setiap atribut bukan kunci primer adalah
bersandar sepenuhnya kepada kunci primer.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Langkah-langkah penormalan :
Hapuskan
Bentuk Normal Ketiga (BN3) kesandaran Transitif
(Third Normal Form (3NF))
Kesandaran fungsian adalah hubungan di antara atribut di mana satu atau sekumpulan
atribut boleh mengenal pasti atribut lain dalam table yang sama.
Kesandaran transitif adalah satu keadaan di mana atribut bergantung kepada atribut
bukan kunci yang lain.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Anomalies is an errors or inconsistencies that may result when a user attempts to update
a table that contains redundant data.
Normalization is a process for assigning attributes into table and reduces data
redundancy and helps eliminate the anomalies problems.
3 level of normalization :
1 NF
2 NF
3 NF
1 NF is a relation where the intersection of each row and column contains no repeating
values.
© Prepared by : nurizah@ict.puo.edu.my
NORMALISATION
F4109: DATABASE SYSTEM
Steps in normalization :
Identify Functional
Dependencies
Second Normal Form (2NF)
Remove Transitive
Third Normal Form (3NF) Dependencies
© Prepared by : nurizah@ict.puo.edu.my