567 views
0 0 votes
If the relation R is in 3NF , then every lossless decomposition will also be in a 3NF ???

Iit is same for BCNF also ??

5 Answers

Best answer
1 1 vote
Yes, lossless decomposition does gurantee that relation will still be in 3NF

Simple proof -
Let us decompose R1 which is in 3NF into R1 and R2.
Suppose R2 is not in 3NF.
Thus there exists a FD A1 -> A2 in R1 which does not satisfy properties of 3NF.
But as decomposition is lossless, A1 -> A2 is also an FD of R!
Thus R is also not in 3NF
Contradiction
Thus R1 is in 3NF

Note : Same holds true for BCNF
• selected by
0 0 votes

If a relation schema \( R \) is in \(\mathbf{BCNF}\) with respect to a set of FDs \( F \), then every projection \( R_S \) (for any \( S \subseteq R \)) with projected dependencies \( \pi_S(F) \) is also in BCNF.

Because,  If a nontrivial FD \( X \to A \) holds in \( R_S \), then \( X \to A \) holds in \( R \).  Since \( R \) is BCNF, \( X \) is a superkey of \( R \)

Hence \( X \) determines every attribute of \( S \), so \( X \) is a superkey of \( R_S \).  Thus BCNF is downward-closed under projection.

 

The analogous claim for \(\mathbf{3NF}\) is false.  A relation can be in 3NF while some component of a lossless decomposition is not in 3NF (counterexample below).

 

Counter example (3NF not preserved under a lossless decomposition).

Let \( R(A,B,C,D) \) with
\[
F \;=\; \{\, AD \to B,\;\; AD \to C,\;\; B \to A \,\}.
\]

(i)  \( R \) is in 3NF.  

Compute keys:  \( AD^+ = A B C D \) (since \( AD \to B \) and \( AD \to C \)), so \( AD \) is a key.  Also \( BD \) is a key because \( B \to A \) and then with \( A D \to C \) we obtain \( C \)

Hence \( BD^+ = A B C D \).  Prime attributes in \( R \) :  \( A, B, D \) (and \( C \) is nonprime).  

Check FDs:  \( AD \to B \) and \( AD \to C \) have LHS as Superkey 

\( B \to A \) has non-superkey LHS but RHS \( A \) is prime.  Hence \( R \) satisfies 3NF (not BCNF due to \( B \to A \)).

 

(ii)  Lossless decomposition \( R \to R_1(A,B,C) \) and \( R_2(B,C,D) \).  

\( R_1 \cap R_2 = \{ B, C \} \).  Since \( B \to A \), we have \( \{ B, C \} \to \{ A, B, C \} = R_1 \)

By the binary lossless-join test \((R_1 \cap R_2) \to R_1 \Rightarrow\) lossless.

 

(iii)  \( R_1 \) is not in 3NF.  

In \( R_1(A,B,C) \), the projected FDs include \( B \to A \).  Keys of \( R_1 \) are \( \{ B, C \} \), so prime attributes in \( R_1 \) are \( B, C \) and \( A \) is nonprime.  The FD \( B \to A \) has LHS not a superkey and RHS nonprime, so 3NF is violated in \( R_1 \).

 

Independence of lossless-join and dependency-preserving.

•  Lossless but not dependency-preserving.  

\( R(A,B,C) \) with \( F = \{ A \to B,\; B \to C \} \).  Decompose into \( R_1(A,B) \) and \( R_2(A,C) \).  
\( R_1 \cap R_2 = \{ A \} \) and \( A \to A B = R_1 \), so the decomposition is lossless.  However, \( B \to C \) cannot be enforced within \( R_1 \) or \( R_2 \) alone, so it is not dependency-preserving.

 

•  Dependency-preserving but lossy.  

\( R(A,B,C) \) with \( F = \{ A \to B \} \).  Decompose into \( R_1(A,B) \) and \( R_2(B,C) \).  
The dependency \( A \to B \) is preserved (it remains in \( R_1 \)), but the decomposition is lossy since \( \{ B \} \) does not functionally determine all attributes of \( R_1 \) or of \( R_2 \).

 

Definitions :

•  BCNF:  For every nontrivial FD \( X \to A \) in \( F^+ \) on \( R \), \( X \) is a superkey of \( R \).

•  3NF:  For every nontrivial FD \( X \to A \) in \( F^+ \) on \( R \), either \( X \) is a superkey of \( R \) \(\;\)or\(\;\) \( A \) is prime (belongs to some candidate key of \( R \)).

•  Binary lossless-join test:  For \( R \to R_1, R_2 \), if \( (R_1 \cap R_2) \to R_1 \) or \( (R_1 \cap R_2) \to R_2 \) holds in \( F^+ \), then the decomposition is lossless.

 

Conclusions :

•  “If \( R \) is in 3NF, then every lossless decomposition is again 3NF?” — False.

•  BCNF is preserved under projection

•  Lossless-join and dependency-preserving are independent. 

 

Reference :

Silberschatz–Korth–Sudarshan, Database System Concepts, Ch. 7 slides:  BCNF/3NF definitions; lossless-join test; decomposition algorithms.  
https://www.db-book.com/slides-dir/PDF-dir/ch7.pdf

• edited by
0 0 votes
not every decomposition will be lossless,

You can always have a lossless decomposition tho, same for BCNF.
0 0 votes

YES 

if  a relation in 3NF then every it is lossless decomp and dependency preserving .
if a  relation in BCNF then every it is lossless decomp and may or may not be dependency preserving

0 0 votes

In simple words 3nf ➡ lossless but not vice versa. Hence False.

Example, R(A,B,C){A➡B} where CK={A,C}, decomposed into R1(A,B), R2(A,C). The decomposition is lossless indeed, but R2 is not in 3nf.

• edited by
Position:
Show:

Related questions

0 0 votes
1 1 answer
602
602 views
bhucho asked Sep 13, 2023
602 views
please can someone help with part (a) of this question.
1 1 vote
2 2 answers
1.0k
1.0k views
garam_masala_ asked Nov 21, 2017
1,006 views
3 3 votes
1 answers 1 answer
1.0k
1.0k views
Rishi yadav asked Oct 6, 2017
1,027 views
10 10 votes
2 answers 2 answers
961
961 views
Deepthi_ts asked Apr 26, 2017
961 views
IF a relation R(A,B,C,D,E) whereAB is the key andADE->Cso is this in 2NF or not?Do Partial dependency exist??? because C is derived from ADE (A is part of key AB)