Download presentation
Presentation is loading. Please wait.
1
1 StudentClass Table sidnameaddrdeptcnumtitleunit 301James11 WestCS143Database04 105Elaine84 EastEE284Signal Processing03 301James11 WestME143Mechanics05 105Elaine84 EastCS143Database04 207Susan12 NorthEE128Microelectronics03
2
2 Missing Info? sidnameaddrdeptcnumtitleunit 301James11 WestCS143Database04 105Elaine84 EastEE284Signal Processing03 301James?ME143Mechanics05 105?84 EastCS143?? 207Susan12 NorthEE128Microelectronics03
3
3 Closure of Attributes X Start with X + = X Repeat until no change in X + If there is Y -> Z with Y X +, then Add Z to X +
4
4 BCNF Decomposition Algorithm For any R in the schema If (X -> Y holds on R AND X -> Y is non-trivial AND X does not contain a key), then 1) Compute X + ( X + : closure of X) 2) Decompose R into R1( X + ) and R2(X, Z) // X becomes common attributes // Z: all attributes in R except X + Repeat until no more decomposition
5
5 Class(cnum, ta, sid) cnumTAsid 143Tony100 143Tony101 143Tony103 143James100 143James101 143James103 248Tony100 248Tony102 248Susan100 248Susan102 Class 143 TA: Tony, James Students: 100, 101, 103 Class 248 TA: Tony, Susan Students: 100, 102
6
6 Inference rules for FDs and MVDs 1.Reflexivity: If Y X, then X -> Y 2.Augmentation: If X -> Y, then ZX -> ZY 3.Transitivity: If X -> Y and Y -> X, then X -> Z 4.Complementation: If X ->> Y, then X ->> R – (Y X) 5.MVD augmentation: If X ->> Y and W Z, then ZX ->> WY 6.MVD transitivity: If X ->> Y and Y ->> Z, then X ->> Z – Y 7.Replication: If X -> Y, then X ->> Y 8.Coalescence: If X ->> Y, W -> Y (Z Y, W Y= ), then X -> Z The set of above rules are sound and complete
7
7 4NF Decomposition Algorithm For any R in the schema If (non-trivial X ->> Y holds on R AND X does not contain a key), then Decompose R into R1(X,Y) and R2(X,Z) // X becomes common attributes // Z: all attributes in R except (X, Y) Repeat until no more decomposition
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.