15 05 Normalisasi
15 05 Normalisasi
NORMALIZATION
for Relational Database
DLOCATION
Multivalued attribute
GUIDELINES in designing tables 6
• Explain:
– insert anomaly
– update anomaly
– delete anomaly
Two relation schemas suffering
from update anomalies 12
Example States for EMP_DEPT
and EMP_PROJ 13
EMP_LOCS
ENAME PLOCATION
EMP_PROJ1
SSN PNUMBER HOURS PNAME PLOCATION
Do not allow
multi-valued
DEPARTMENT_1NF
Normalization into 1NF 32
SOAL:
3.3 Second Normal Form (1)
• Definition:
• A relation schema R is in second normal form (2NF)
if every non-prime attribute A in R is fully
functionally dependent on the primary key
FD of not ??
35
Normalization into 2NF 36
SOAL
Summary of previous meeting
1 NF and 2 NF 37
Do not allow
multi-valued
DEPARTMENT_1NF
Normalization into 2NF 39
• Definition:
• Transitive functional dependency - a FD X Z that
can be derived from two FDs X Y and Y Z
• Examples:
• SSN DMGRSSN is a transitive FD since SSN
DNUMBER and DNUMBER DMGRSSN hold
• SSN ENAME is non-transitive since there is no set
of attributes X where SSN X and X ENAME
4. General Normal Form
Definitions (For Multiple Keys) (1) 42
• Definition:
• Superkey of relation schema R - a set of attributes S
of R that contains a key of R
• A relation schema R is in third normal form (3NF) if
whenever a FD X A holds in R, then either:
• (a) X is a superkey of R, or
• (b) A is a prime attribute of R
• NOTE: Boyce-Codd normal form disallows
condition (b) above
5. BCNF (Boyce-Codd Normal
Form) 44
- Identify FD
- Illustrate the normalization process to 1NF, 2NF, 3NF
dan BCNF
staffNo dentistName patNo patName appointment surgeryNo
date time
S1011 Tony Smith P100 Gillian White 12-Sep-08 10.00 S15
S1011 Tony Smith P105 Jill Bell 12-Sep-08 12.00 S15
S1024 Helen Pearson P108 Ian MacKay 12-Sep-08 10.00 S10
S1024 Helen Pearson P108 Ian MacKay 14-Sep-08 14.00 S10
S1032 Robin Plevin P105 Jill Bell 14-Sep-08 16.30 S15
S1032 Robin Plevin P100 Gillian White 15-Sep-08 18.00 S13
Unnormalized
Not organized
1st NF
Disallows composite
attributes, multivalued
attributes, and nested
relations; attributes
whose values for an
individual tuple are non-
atomic
2nd NF
Every non-prime attribute
A in R is fully functionally
dependent on the primary
key
3rd NF