2,830 views
1 votes
1 votes

Suppose you are given a relation R with four attributes ABCD. For
each of the following sets of FDs, assuming those are the only dependencies that hold
for R, do the following:  If R is not in BCNF,
decompose it into a set of BCNF relations that preserve the dependencies.

AB → C, AB → D, C → A, D → B

1 Answer

Best answer
2 votes
2 votes

Given R(ABCD) ,and the given FD set 

AB --> C , AB --> D , C --> A  , D -->B

Hence the candidate key = AB as (AB)+ = (ABCD)

So C and D are not superkeys 

Hence the given relation is not in BCNF as it requires every LHS side must be a superkey and C and D are not even candidate keys.

Hence we need BCNF decomposition preferably having lossless and dependency preserving property.First of all , we should know given a decomposition , how to map the functional dependencies from the original relation(table) into subrelations .They may be directly mapped or indirectly.

Let us consider a decomposition  S(ABC) and T(ABD)  .So let us consider the dependencies that will be mapped into S and to T from original relation R one by one.

a) For S(ABC) :

For ABC , the dependencies mapped will be :

AB --> C

C  -->   A

b) For T(ABD) :

For T(ABD) , the dependencies will be :

AB --> D

D   --> B

So we can see that all of the functional dependencies from the original relation are satisfied and hence dependency preserving .But here also D is not a key for the subrelation T and C is not a key for S .

So this is not a BCNF decomposition.

So we have to construct separate subrelations(tables) for (CA) and (DB).Lets do that

Let W = (AC) having FD  :  C --> A

and  X = (BD) having FD :  D --> B

and  Y = (ABC) having FD : AB --> C

and  Z  = (ABD) having FD : AB --> D

Now many of us can have doubt that we could have kept C --> A in Y(ABC) but it is not necessary.If a dependency is implied using any relation that is sufficient.Also with a given subrelation , we can define the FDs of subrelation according to our convenience but that should be in accordance with the original FD set .So for that reason only we are keeping AB --> C in Y(ABC) only not C -->A as it is mapped to W(AC) already and hence sufficient for dependency preservation.

Hence the above decomposition is BCNF decomposition and also having dependency preservation and lossless join property

selected by

Related questions

0 votes
0 votes
0 answers
3
Nishtha_Agarwal asked Dec 31, 2018
678 views
Options area- not in 3nf,in bcnfb- in 3nf,not in bcnfc- in 3nf, in bcnfd- not in 3nf, not in bcnf
2 votes
2 votes
2 answers
4
gatecrack asked Dec 10, 2018
618 views
Is minimal set of functional dependency for a functional dependency set is always unique???