DBS Lecture 11
DBS Lecture 11
Database Systems 3
Chapter 4:
Logical Database Design
and the Relational Model
Modern Database Management
12th Edition
Jeffrey A. Hoffer, Mary B. Prescott,
Fred R. McFadden
Advance Normal Forms
Database Systems 5
Boyce-Codd Normal Form
Database Systems 6
BCNF Example
• A student can have more than one major
• A student has a different advisor for each major
• Each advisor advises for only one major
Database Systems 7
BCNF Description
• Primary Key for this relation is composite key consisting of SID and Major
• Thus, two attributes Advisor and MajGPA are functionally dependent on this
primary key
• There exist another functional dependence i.e. Major (a key attribute) is
functionally dependent on Advisor (non-key attribute)
• That is, each advisor advises in exactly one major
• Notice that it is not a Transitive Dependency
Database Systems 8
Definition of BCNF
Database Systems 9
Converting a Relation to BCNF
Database Systems 10
Converting a Relation to BCNF
11
Fourth Normal Form – 4NF
4th Normal Form is violated if:
• Boyce Codd Normal Form is violated
• If there exists a partial key which has multiple independent
multi-valued functional dependencies to other partial keys
partial-key1 partial-key2
partial-key3
• Multi-valued Dependency exists when there are at
least 3 attributes (e.g, A, B and C) in a relation, and for
each value of A there is a set of values of B and a set
of values of C
Database Systems 12
Example 1 – 4NF
Instruments_Languages
Database Systems 13
4NF Example – Violation
Database Systems 14
4NF Example – Correction
Database Systems 15
Example 2 – 4NF
Database Systems 16
Example 2 – 4NF
17
5NF
Database Systems 18
Domain Key Normal Form (DKNF)
Database Systems 19
Merging Relations
• View Integration – Merging relations (also called view integration)
is combining entities from multiple ER models into common
relations
Database Systems 20
Merging Relations
Database Systems 21
Merging Relations
• Transitive dependencies –Even if relations are in 3NF prior to
merging, they may become in 2NF due to transitive dependencies
between non-key attributes
• STUDENT1(StudentID, MajorName)
STUDENT2(StudentID, Advisor)
Database Systems 22
Merging Relations
• Super-type/subtype relationships –These relationships may be
hidden prior to merging i.e. Patient-> ResPatient and OutPatient
Database Systems 23
THANKS