Multivalued Dependencies by Asmerom Tekeste
Normal Forms 1NF 2NF 3NF BCNF 4NF 5NF Functional dependencies Multivalued dependencies Join dependencies
Recall Normal Forms ABCDE FD: { B, C, D, E}A Example: R (A, B, C, D, E)
Normal Form of R (A,B,C,D,E) 1NF: no multivalues 2NF: no FDs where a subset of the key to the relation is on the left 3NF: no non-trivial FDs, either the determinant is a superkey or the RHS of the FD is a member of some key BCNF: the determinant of any non-trivial FD is a superkey for the relation
Normal Form (cont) NameAddrStreetAddrCityFilmNameFilmYear C. Fisher123 Maple Dr.HollywoodStar Wars1977 C. Fisher5 Locust Ln.MalibuStar Wars1977 C. Fisher123 Maple Dr.HollywoodThe Empire Strikes Back 1980 C. Fisher5 Locust Ln.MalibuThe Empire Strikes Back 1980 C. Fisher123 Maple Dr.HollywoodReturn of the Jedi1983 C. Fisher5 Locust Ln.MalibuReturn of the Jedi1983 Stars
R T x U x V (R is similar to the Cartesian product of relations T, U, and V) AddrStreetAndCity 123 Maple Dr. | Hollywood 5 Locust Ln. | Malibu FilmNameAndYear Star Wars | 1977 The Empire Strikes Back | 1980 Return of the Jedi | 1983 Relation URelation V Name C. Fisher Relation T ~ ~ Normal Form (cont) - The relation Stars is in BCNF
Problems with relation Stars - No reason to associate address with one movie and not another - When we repeat address and movie facts in all combinations, there is obvious redundancy - Relation R contains unnecessary duplication of data The relation Stars doesn’t seem to be sufficiently normalized Reasons:
Introducing MVD Definitions: -A MVD: A1A2…An B1B2…Bn for a Relation R is “non- trival” if 1. none of the Bs are among the As 2. not all of the attributes of R are among the As and Bs -A MVD is “trivial” if A1A2…An B1B2…Bm where B1B2…Bm is a subset of A1A2…An or ( A1A2…An U B1B2…Bn ) contains all attributes of R -A relation cannot be decomposed any further (under 4NF rules) if it has a trivial MVD
More on MVD Definitions (cont): A1A2…An B1B2…Bm holds for relation R if: For all tuples t, u in R If t[A1A2...An] = u[A1A2...An], then there exists a v in R such that: (1) v[A1A2...An] = t[A1A2...An] = u[A1A2...An] (2) v[B1B2…Bm] = t[B1B2…Bm] (3) v[C1C2…Ck] = u[C1C2…Ck], where C1C2…Ck is all attributes in R except (A1A2...An B1B2…Bm)
-Intuitively, A1A2…An B1B2…Bm says that the relationship between A1A2…An and B1B2…Bm is independent of the relationship between A1A2…An and R -{B1B2…Bm} - MVD's uncover situations where independent facts related to a certain object are being squished together in one relation -Functional dependencies rule out certain tuples from being in a relation - if A B, then we can’t have two tuples with the same A values but different B - a.k.a. equality-generating dependencies Multivalued dependencies require that other tuples of a certain form be present in the relation - a.k.a. tuple-generating dependencies More on MVD
MVD Example: is A C ABCD ACBD r1 r2 r3 r4 r5 r6 r7 t1=r5 t2=r7 t3=r7 t4=r5 t1=r1 t2=r2 t3=r1 t4=r t1=r1 t2=r4 t3=r1 t4=r4
Theories of MVD REPLICATION FD is an MVD If A1A2…An B1B2…Bm then A1A2…An B1B2…Bm holds COMPLEMENTATION If A1A2…An B1B2…Bm then A1A2…An C1C2…Ck where C1C2…Ck is all attributes in R except (A1A2…An B1B2…Bm) AUGMENTATION If X Y and W Z then WX YZ
TRANSITIVITY If X Y and Y Z then X (Z-Y) REFLEXIVITY if A is a set of attributes and A B, then A B holds. REPLICATION if A B holds, then A B. Theories of MVD (cont)