# Manajemen data

Lossless Join Example discussed in the lecture

Let Ur = ABCDE, R1 = AD, R2 = STOMACH, R3 = BE, R4 = CDE, and R5 = STRYGE. Let the efficient dependencies end up being: A -> C, N -> C, C -> D, SOBRE -> C, CE -> A

Apply algorithm 7. 2 via class handout to test if the decomposition of R in to R1,..,R5 is actually a lossless join decomposition.

Your initial table looks as follows:

A

R1(AD)

R2(AB)

R3(BE)

R4(CDE)

R5(AE)

N

C

G

E

a2

a1

b31

b41

a1

b12

a2

a2

b42

b52

b13

b23

b33

a3

b53

a4

b24

b34

a4

b54

b15

b25

a5

a5

a5

Apply FD A -> C to the initial desk to modify the violating dependencies. Rows 1, 2, your five will need to change the values for the RHS attribute C вЂ“ associate b13, b23, b53 to b13 (you might perfectly have selected b23 or perhaps b53 to equate every three). All of us won't change the rows a few & some yet mainly because their symbols b31, b41 are different from a2.

A

a2

a1

b31

b41

a1

B

b-12

a2

a2

b42

b52

C

b13 b13

b23 b13

b33

a3

b53 b13

G

a4

b24

b34

a4

b54

E

b15

b25

a5

a5

a5

Apply B -> C up coming to equate b33 with b13

A

a1

a2

b31

b41

a1

N

b12

a2

a2

b42

b52

C

b13 b13

b23 b13

b33 b13

a3

b53 b13

M

a4

b24

b34

a4

b54

E

b15

b25

a5

a5

a5

Subsequent, use C -> D to equate a4, b24, b34, and b54

A

a1

a2

b31

b41

a1

N

b12

a2

a2

b42

b52

C

b13 b13

b23 b13

b33 b13

a3

b53 b13

M

a4

b24 a4

b34 a4

a4

b54 a4

E

b15

b25

a5

a5

a5

DE -> C assists us to equate b13 (all occurrences) with a3. The following desk shows the related changes.

A

a1

a2

b31

b41

a1

N

b12

a2

a2

b42

b52

C

b13 b13 a3

b23 b13 a3

b33 b13 a3

a3

b53 b13 a3

M

a4

b24 a4

b34 a4

a4

b54 a4

E

b15

b25

a5

a5

a5

Apply VOTRE -> A to the table above to associate b31, b41, and a1. A

a2

a1

b31 a1

b41 a1

a2

B

b-12

a2

a2

b42

b52

C

b13 b13 a3

b23 b13 a3

b33 b13 a3

a3

b53 b13 a3

D

a4

b24 a4

b34 a4

a4

b54 a4

At the

b15

b25

a5

a5

a5

The center row in the table above is all a's, and the decomposition has a lossless join. --------------------------------------------------------------------------------------------------------------------What happens if we apply FDs in a distinct order? Make an effort any FD with the same symbols (a or b) on the LHS attribute in at least two rows. We have two choices: A -> N or M -> C. We tried out A -> B in the previous test. Try B -> C here. A

B

C

Deb

E

a2

a1

b31

b41

a2

b12

a2

a2

b42

b52

b13

b23 b23

b33 b23

a3

b53

a4

b24

b34

a4

b54

b15

b25

a5

a5

a5

Apply A -> C after that to obtain the following desk. Notice I selected b23 to equate b13, b23, and b53.

A

B

C

D

At the

a1

a1

b31

b41

a1

b-12

a2

a2

b42

b52

b13 b23

b23 b23

b33 b23

a3

b53 b23

a4

b24

b34

a4

b54

b15

b25

a5

a5

a5

The table demonstrated above is the similar to the 1 we got ahead of after making use of A -> C and B-> C to the primary table. To the present table all of us apply C -> Deb as ahead of because we have the same image b23 in rows 1, 2, 3, and 5.

16.08.2019