# Difference between 3NF and BCNF in DBMS

1. Third Normal Form (3NF) :
A relation is said to be in Third Normal Form (3NF), if it is in 2NF and when no non key attribute is transitively dependent on the primary key i.e., there is no transitive dependency. Also it should satisfy one of the below given conditions. For the function dependency C->D:

• C should be a super key and,
• D should be a prime attribute i.e, D should be a part of the candidate key.

3NF is used to reduce data duplication and to attain data integrity.

Example:
For the relation R(L, M, N, O, P) with functional dependencies as {L->M, MN->P, PO->L}:

```The candidate keys will be : {LNO, MNO, NOP}
as the closure of LNO = {L, M, N, O, P}
closure of MNO = {L, M, N, O, P}
closure of NOP = {L, M, N, O, P}```

This relation is in 3NF as it is already in 2NF and has no transitive dependency. Also there is no non prime attribute that is deriving a non prime attribute.

2. Boyce-Codd Normal Form (BCNF) :
BCNF stands for Boyce-Codd normal form and was made by R.F Boyce and E.F Codd in 1974.A functional dependency is said to be in BCNF if these properties hold:

• It should already be in 3NF.
• For a functional dependency say P->Q, P should be a super key.

BCNF is an extension of 3NF and it is has more strict rules than 3NF. Also, it is considered to be more stronger than 3NF.

Example:
for the relation R(A, B, C, D) with functional dependencies as {A->B, A->C, C->D, C->A}:

```The candidate keys will be : {A, C}
as the closure of A = {A, B, C, D}
closure of C = {A, B, C, D} ```

This relation is in BCNF as it is already in 3Nf (there is no prime attribute deriving no prime attribute) and on the left hand side of the functional dependency there is a candidate key.

Difference between 3NF and BCNF :

S.NO. 3NF BCNF
1. In 3NF there should be no transitive dependency that is no non prime attribute should be transitively dependent on the candidate key. In BCNF for any relation A->B, A should be a super key of relation.
2. It is less stronger than BCNF. It is comparatively more stronger than 3NF.
3. In 3NF the functional dependencies are already in 1NF and 2NF. In BCNF the functional dependencies are already in 1NF, 2NF and 3NF.
4. The redundancy is high in 3NF. The redundancy is comparatively low in BCNF.
5. In 3NF there is preservation of all functional dependencies. In BCNF there may or may not be preservation of all functional dependencies.
6. It is comparatively easier to achieve. It is difficult to achieve.
7. Lossless decomposition can be achieved by 3NF. Lossless decomposition is hard to achieve in BCNF.

Article Tags :
Practice Tags :