CS157a
Chris Pollett
Sep 25, 2019
title year length genre studioName starName ----------------------------------------------------------- Star Wars 1977 124 SciFi Fox Carrie Fisher Star Wars 1977 124 SciFi Fox Mark Hamill Star Wars 1977 124 SciFi Fox Harrison Ford Gone With the Wind 1939 231 drama MGM Vivien Leigh Wayne's World 1992 95 comedy Paramount Dana Carvey Wayne's World 1992 95 comedy Paramount Mike Meyers
In the below, we slightly abuse notation by identifying in places a relation with its set of attributes.
Input. A relation `R_0` with a set of FDs `S_0`.
Output. A decomposition of `R_0` into a collection of relations, all of which are in BCNF.
Method. The following steps are applied recursively to any relation `R` and set of FDs `S`. Initially, set `R = R_0`, `S= S_0`.
A B C ----- 1 2 3 4 2 5Notice neither `B->A` nor `B->C` holds.
A B --- 1 2 4 2and
B C --- 2 3 2 5
A B C ----- 1 2 3 1 2 5 4 2 3 4 2 5which is not the same as the original table.
A B C D ----------- a b1 c1 d a b2 c d2 a3 b c d
A B C D ----------- a b1 c1 d a b1 c d2 a3 b c d
A B C D ----------- a b1 c d a b1 c d2 a3 b c d
A B C D ----------- a b1 c d a b1 c d2 a b c d