in Databases
274 views
0 votes
0 votes

what is correct and fastest way to check whether dependencies are preserved or not? 

Consider this question https://gateoverflow.in/3371/gate2008-it-61

In this question , If Arjun Sir haven't mentioned about ,

C→D is indirectly present via C→B in (B,C) and B→D in (B,D).

I wouldn't have come to know about C→B & B→D.

How to identify these FD's correctly 

I have one method , can someone verify if it is correct or not 

This is wrong way

generally we take FD's given in F and try to distribute it to sub relation 

hence A→B will go to (A,B) 

          B→C will go to (B,C)

         D→B will go to (B,D)  

and C→D will remained unmapped , also we can't derive it using other 3 FD's. hence dependency not preserved  hence we get wrong answer.

Correct Way 

Given FD's for F find F+ (closure of FD's of F) then we will get 

A→B , B→C ,  D→B , C→D  & B→D & C→B 

Now you try to distribute this Fd's 

hence A→B will go to (A,B) 

          B→C  & C→B  will go to (B,C)

         D→B  & B→D will go to (B,D)  

and C→D will remained unmapped  , now if we try to derive C→D from Above FD we will be able ro derive it , hence dependency preserved. 

Can someone please verify whether it is correct way to check dependency preservation ?

 

in Databases
274 views

2 Comments

yes, your approach is right but sometimes it takes more time. why because you are taking every FD from F+.


you have the following dependencies: A→B , B→C ,  D→B , C→D

and having the tables R into R1(A,B), R2(B,C), R3(B,D).

Step 1:-

R1(A,B) will have :-  A→B

R2(B,C) will have :-   B→C

R3(B,D). will have :- D→B

 

Step 2:-  Check table wise, that each table can get more FD's or not, then you realized that  

R1(A,B) will have :-  A→B

R2(B,C) will have :-   B→C, C→B (due to C→D and D→B )

R3(B,D). will have :- D→B, B→D (due to C→D and B→C )

Step 3:- Now, Check Dependency Preserving   

C→D is covered by C→B ( of Table) and B→D ( of Table)

1
1
thank you , from  now onward I will follow this procedure only
0
0

Please log in or register to answer this question.

Related questions