# Multivalued Dependency (MVD) & Join Dependency (JD) The third type of DD is related to the decomposition restriction on a single schema. This includes.

## Presentation on theme: "Multivalued Dependency (MVD) & Join Dependency (JD) The third type of DD is related to the decomposition restriction on a single schema. This includes."— Presentation transcript:

Multivalued Dependency (MVD) & Join Dependency (JD) The third type of DD is related to the decomposition restriction on a single schema. This includes multivalued dependency (MVD) and join dependency (JD)

Multivalued Dependency (MVD) Notation: MVD ├ A  B Example –In the relation pattern. An MVD dept  course is satisfied. t1 [dept] = t2 [dept] = t3 [dept] = t4 [dept] = 1 t3 [course] = t1 [course] = COMP104 t4 [course] = t2[course] = COMP171 Also, t5 [dept] = t6 [dept] = t7 [dept] = t8 [dept] = 2 t7 [course] = t5 [course] = ELEC102 t8 [course] = t6 [course] = ELEC151

Multivalued Dependency (MVD) sidsnamesprogramsdept 1001stud_ABEng(COMP)1 1002stud_BBEng(COMP)1 1003stud_CBEng(ELEC)2 1004stud_DBEng(ELEC)2 deptcourse 1COMP104 1COMP171 2ELEC102 2ELEC151 student requirement

Multivalued Dependency (MVD) studentdeptcourse 10011COMP104 10011COMP171 10021COMP104 10021COMP171 10032ELEC102 10032ELEC151 10042ELEC102 10042ELEC151 Two students in the same department take the same courses pattern

Multivalued Dependency (MVD) Example (cont’d) –In other words, students in the same department follow the same study pattern to take courses. –Students (1001, 1002) in the Computer Sci. department take COMP104 and COMP171 –and those (1003, 1004) in the Electronic Eng. department take ELEC102 and ELEC151. Example

Join Dependency (JD) JD is the general version of MVD If the schema can be broken up into n (n≥1) or more schema losslessly, the schema obeys JD. particularly, when n=1, it is the trivial case. when n=2, it is actually MVD.

Join Dependency (JD) Example –In the relation enrollment –JD ((student, course), (course, lecturer), (student, lecturer)) holds, –but JD ((student,course), (course,lecturer)) does not. studentcourselecturer 1001COMP1041 1001COMP1713 1002COMP1042 1002COMP1713 1003ELEC1024 1003ELEC1515 1004ELEC1024 1004ELEC1516 enrollment

Join Dependency (JD) –Decompose the relation enrollment into 3 relations as follows CourseLecturer COMP1041 2 COMP1713 ELEC1024 ELEC1515 6 StudentLecturer 10011 3 10022 3 10034 5 10044 6 StudentCourse 1001COMP104 1001COMP171 1002COMP104 1002COMP171 1003ELEC102 1003ELEC151 1004ELEC102 1004ELEC151

Join Dependency (JD) –When the three relations are joined back together, it will be the same as before decomposing. –But joining the first two relations ((student, course), (course, lecturer)) would generate some spurious results. –The natural join is as shown in the next slide

Join Dependency (JD) StudentCourseLecturer 1001COMP1041 1001COMP1042 1001COMP1713 1002COMP1041 1002COMP1042 1002COMP1713 1003ELEC1024 1003ELEC1515 1003ELEC1516 1004ELEC1024 1004ELEC1515 1004ELEC1516 The tuples with red values are spurious. They do not exist in the original enrollment relation. Therefore the JD of joining these two relations does not hold.

Download ppt "Multivalued Dependency (MVD) & Join Dependency (JD) The third type of DD is related to the decomposition restriction on a single schema. This includes."

Similar presentations