Ecomposition Chema Ormalization: CS 564-Fall 2016
Ecomposition Chema Ormalization: CS 564-Fall 2016
SCHEMA NORMALIZATION
1. minimize redundancy
2. avoid information loss (lossless-join)
3. preserve the FDs (dependency preserving)
4. ensure good query performance
R1(A, B) R2(B, C)
lossless-join
• decomposition into R1(A, B, C) and R2(A, D)
Not lossless-join
• decomposition into R1(A, B, C) and R2(D)
decomposes into
• R1(SSN, name, age)
– 𝑆𝑆𝑁 ⟶ 𝑛𝑎𝑚𝑒, 𝑎𝑔𝑒
• R2(age, canDrink)
– 𝑎𝑔𝑒 ⟶ 𝑐𝑎𝑛𝐷𝑟𝑖𝑛𝑘
CS 564 [Fall 2016] - Paris Koutris 13
BAD EXAMPLE
R1 R2
R(A, B, C)
A B A C
• 𝐴⟶𝐵 a1 b a1 c
• 𝐵, 𝐶 ⟶ 𝐴 a2 b a2 c
• R2(A, C) a2 b c
R1 R2
B’s A’s remaining
attributes
R1 R2
name
SSN phoneNumber
age
BCNF decomposition:
– removes certain types of redundancy
– is lossless-join
– is not always dependency preserving
R(A, B, C)
• 𝐴⟶𝐵
• 𝐵, 𝐶 ⟶ 𝐴
Is is in BCNF?
• No, because the left hand side of both (not trivial) FDs
is not a superkey!