• edited by
79,193 views
185 185 votes

$R(A,B,C,D)$ is a relation. Which of the following does not have a lossless join, dependency preserving $BCNF$ decomposition?

  1. $A \rightarrow B, B \rightarrow CD$
  2. $A \rightarrow B, B \rightarrow C, C \rightarrow D$
  3. $ AB \rightarrow C, C \rightarrow AD$
  4. $A \rightarrow BCD$

8 Answers

Best answer
216 216 votes

taking up option A first :
We have, R(A, B, C, D) and the Functional Dependency set = {A→B, B→CD}.
Now we will try to decompose it such that the decomposition is a Lossless Join, Dependency Preserving and new relations thus formed are in BCNF.
We decomposed it to R1(A, B) and R2(B, C, D). This decomposition satisfies all three properties we mentioned prior.

taking up option B :
we have, R(A, B, C, D) and the Functional Dependency set = {A→B, B→C, C→D}.
we decomposed it as R1(A, B), R2(B, C) and R3(C, D). This decomposition too satisfies all properties as decomposition in option A.

taking up option D :
we have, R(A, B, C, D) and the Functional Dependency set = {A→BCD}.
This set of FDs is equivalent to set = {A→B, A→C, A→D} on applying decomposition rule which is derived from Armstrong's Axioms. 
we decomposed it as R1(A, B), R2(A, C) and R3(A, D). This decomposition also satisfies all properties as required.

taking up option C :
we have, R(A, B, C, D) and the Functional Dependency set = {AB→C, C→AD}.
we decompose it as R1(A, B, C) and R2(C, D). This preserves all dependencies and the join is lossless too, but the relation R1 is not in BCNF. In R1 we keep ABC together otherwise preserving {AB→C} will fail, but doing so also causes {C→A} to appear in R1. {C→A} violates the condition for R1 to be in BCNF as C is not a superkey. Condition that all relations formed after decomposition should be in BCNF is not satisfied here.

We need to identify the INCORRECT, Hence mark option C.

• selected by
62 62 votes
(C) is the answer. Because of AB $\to$ C and C $\to$ A, we cannot have A, B and C together in any BCNF relation- in relation ABC, C is not a super key and C$\to$ A exists violating BCNF condition. So, we cannot preserve  AB $\to$ C dependency in any decomposition of ABCD.

For (A) we can have AB, BCD, A and B the respective keys
For (B) we can have AB, BC, CD, A, B and C the respective keys
For (D) we can have ABCD, A is key
14 14 votes
(A) A->B, B->CD

AB and BCD, B is the key of second and hence decomposition is lossless.

(B) A->B, B->C, C->D

AB, BC, CD B is the key of second and C is the key of third, hence lossless.

(C) AB->C, C->AD

ABC, CD. C is key of second, but C->A violates BCNF condition in ABC as C is not a key. We cannot decompose ABC further as AB->C dependency would be lost. Hence the ANSWER.

(D) A ->BCD

Already in BCNF.
3 3 votes

R(ABCD)

a)      A --> B          B --> CD

Candidate key= A 

So,

A --> B              In BCNF   (Bec A is the superkey)

B --> CD           (Violation of BCNF)

Therefore not in BCNF. So Decompose into BCNF

B -->CD

Closure of B = BCD     

So R1 = BCD   (In BCNF)

      R2=  AB      (In BCNF)

Now Check lossless or Lossy join 

R1 ∩ R2 = B      (B is SK in R1) 

So lossless 

Now Check dependency preserving 

A --> B           Dependency preserved in  R2

B --> CD         Dependency preserved in  R1

So dependency preserved 

------------------------------------------------------

b)      A --> B     

        B --> C

        C --> D

CK= A

So, 

         A --> B       (In BCNF)   bec A is SK 

        B --> C       Not in BCNF

        C --> D       Not in BCNF 

So decompose into BCNF 

B --> C 

Closure of B = BCD

R1= BCD   ( Again not in BCNF)

R2= AB      (In BCNF)

Take violation and decompose into BCNF

R1= BCD 

B--->  C                 C---> D

CK= B 

So,

B --->  C   (In BCNF) 

C---> D    (Not in BCNF)

Take violation and decompose into BCNF

Closure of C = CD 

R1= CD  (In BCNF)

R2= BC   (In BCNF)

So  Decomposition BCNF

R1= (AB)     R2=(BC)      R3=(CD)

Now Check lossless or Lossy join 

R1 ∩ R2 = B      (B is SK in R1)        R2 ∩ R3 = C      (C is SK in R3) 

So lossless 

Now Check dependency preserving 

A --> B           Dependency preserved in  R1

B --> C         Dependency preserved in  R2

C --> D            Dependency preserved in  R3

So dependency preserved 

-----------------------------------------------------

d)  A-->  BCD

CK= A 

So,   A-->  BCD  (In BCNF)   A is the superkey 

Here no BCNF Decomposition Required 

so here it is already in BCNF, Lossless and dependency preserving.

-------------------------------------------------

c)  AB ---> C,   C---> AD

CK= AB, BC 

AB ---> C        (In BCNF )  (Bec AB is the superkey)

C---> AD        (Violation of BCNF)

Therefore not in BCNF. So Decompose into BCNF

Take a Violation 

C ---> AD

Closure of C= CAD

R1= CAD        (In BCNF)

R2= BC             (In BCNF)

Now Check lossless or Lossy join 

R1 ∩ R2 = C      (B is SK in R2) 

So lossless

Now Check dependency preserving 

AB --> C           Dependency Not preserved 

C --> AD         Dependency preserved in  R1

So dependency not  preserved 

 

so C is the Correct answer

------------------------------------------------------------

BCNF Decomposition Algo:

if R is not in BCNF:

Take a violation   X--->  A    (X is not SK)

Decompose R in R1, R2:

R1(Closure of X)     R2(R - (Closure of X )+ X)

1 1 vote

Initially FD X-> Y is in BCNF if

X is superkey

A) A is candidate key but B->CD voilates since B is not super key (not BCNF)

B)A is candidate key but B->C,C->D voilates since B,C are not super key (not BCNF)

C)AB , CB are candidate keys but C->D voilates since C alone is not SuperKey  (not BCNF)

D) A is candidate Key and satisfies BCNF

Therefore Option D is BCNF

A,B,C are not BCNF

• edited by
1 1 vote
Option C: R(A, B, C, D) and the Functional Dependency set = {AB→C, C→AD}

Candidate keys are AB, CB & C→ AD violates BCNF, so decompose it using BCNF decomposition algorithm (Source: Navathe). C+ = CAD. Decomposition is R1(BC) and R2(CAD).

C→AD is preserved but AB → C can’t be preserved. So decomposition is in BCNF but not dependency preserving hence option C is the right answer.
Answer:
Position:
Show:

Related questions

85 85 votes
9 answers 9 answers
20.4k
20.4k views
Kathleen asked Sep 14, 2014
20,414 views
Consider a relation geq which represents "greater than or equal to", that is, $(x,y) \in $ geq only if $y \geq x$.create table geq ( ib integer not null, ub integer not n...
61 61 votes
10 answers 10 answers
16.7k
16.7k views
Kathleen asked Sep 14, 2014
16,741 views
Which of the following relational calculus expression is not safe?$\left\{t \mid \exists u \in R_1\left(t[A] = u[A]\right) \land \neg \exists s \in R_2 \left(t[A] = s[A]\...
12 12 votes
4 answers 4 answers
4.3k
4.3k views
go_editor asked Feb 8, 2018
4,289 views
Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real number.Write an SQL query to list the regno of examinees who have a s...
12 12 votes
3 3 answers
4.3k
4.3k views
go_editor asked Feb 8, 2018
4,322 views
Consider a relation $\text{examinee (regno, name, score)},$ where regno is the primary key to score is a real number.Suppose the relation $\text{appears (regno, centr_cod...