edited by
2,295 views
4 votes
4 votes

how many foreign keys required for the following relation R (ABCDEF) with FD ( AB ⇒C,BC ⇒A , AC ⇒B ,D ⇒E) into BCNF and lossless join, dependency preserving decomposition?

edited by

2 Answers

4 votes
4 votes

First we find key of the given relation.

(AC)+ = (ABCD) and hence AC is the candidate key of the relation and hence A and C which are determinants are not superkeys.So we need to separate them.

(AB)+ = (ABC)

(BC)+ = (ABC)

(AC)+ = ( ABC)

So we take R1(A,B,C) in  which will have AB--> C , AC --> B and BC --> A.

D+  = (DE) .So we take R2(D,E) which will have D --> E.

Hence all original FDs are mapped into subrelations so dependency preservation is done.Also R1 and R2 are in BCNF.But still lossless property is not satisfied since we have nothing common between R1 and R2.So we take another table R3 which will have attributes (F,D) so on taking join with R2 we will get D which is superkey for R2 and then take intersection of R1 and joined result(which contains D,E and F as attributes), which is now NULL.So we need to include more attributes in R3 from R1 such that we get common attributes such that it is a key for either R1 or the joined result.So we can include either AB, BC or AC in the joined result of R2 and R3 and hence in R3.Here in R3, the attribute {D} will reference to R2 and AB (or) AC (or) BC will reference to R1

So minimum no. of relations = 3 and minimum no. of foreign keys = 2 [Here D and (AB) or (BC) or (AC) ]

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
atulcse asked Jan 15, 2022
684 views
How many minimum relations are required for the following Relation R(A, B, C, D, E) with FD {A → BC, CD → E, B → D, E → A} to convert into BCNF without violation ...