Академический Документы
Профессиональный Документы
Культура Документы
•Bottom-up Perspective
•Normalization
•1NF, 2NF, to 3NF
❚ Top Down
❙ Identifying entities
❙ Identifying relationships
❙ Normalizing cardinalities
❘ Eg., M:N relationships get broken down to 1:M
and M:1 via a bridge entity
❚ Bottom Up
❘ Start off with existing forms and reports and
normalize to 3rd normal form (3NF)
Top Down Vs. Bottom Up
• To ❙Faster
pDo
wn ❙Futuristic
❙Slower
❙More accurate process
•Bottom-up
Which is better?
Top Down or Bottom-Up?
❚ Top down
❙ Can be faster than bottom up.
❙ Can be futuristic. Can project new
entities (and hence tables).
❚ Bottom-up
❙ Slower
❙ Entities (and hence tables) identified
from bottom up are based on existing
forms and reports.
❙ More accurate process.
Bottom Up Design
Normalization
Normalization
full dependency
A B C D E F
partial transitive
dependency dependency
How Do We Normalize?
3NF
full dependency
A B C D E F
partial transitive
dependency dependency
How Do We Normalize?
3NF
full dependency
A B C D E F
partial transitive
dependency dependency
How Do We Normalize?
3NF
full dependency
A B D E
Normalization Steps
❚ Your table is in UNF if it has repeating groups of
data. Remove them!
❙ The table is now in 1NF.
❚ Remove partial dependency.
❙ eg., B,C (duplicate the key B)
❙ What remains is ABDEF.
❙ The table is in 2NF.
❚ Remove transitive dependency.
❙ eg., E,F (duplicate E, which becomes a key).
❙ The tables are now in 3NF.
Case Study: Normalization
STUDENT TRANSCRIPT FORM 11/2/9
Student # 999-99-9999 Name: Richie Rich 8
Address: 6 Chicory Rd, Andover, MA 01886
GPA 3.5
Case Study
1 2
4
3
Course# Student#
Instructor# Name Grade
Course# Course_Description
Case Study
Name is dependent on
Instructor# primarily
Instructor # InstructorName
Case Study
Instructor # Name
Not
Course# Student# Grade linked
Instructor # Name
Question
❚ How do you link Instructor?
❚ Hint:
❙ The link should be on the side of the Many.
❙ That is, the course table should have Instructor
# as the foreign key.
❚ Why not the other way around?
❙ That is, why not attach Course# to the
Instructor table?
❙ Think about the drawback of this option.
Case Study
Instructor # Name
A B C D E F
a = ID (PK)
b = Employee Name
c = street.
d = city Is this in 3NF?
e = state
f = zip
Exercise B: Normalize This Invoice
Total 3500
Summary
Summary
❚ Un-normalized: Contains repeating
groups
❙ Resolution: Remove them!