3Nf, BCNF, 4Nf & 5Nf: UNIT-3 Rdbms BCA304 Presenter-Daisy Sharmah
3Nf, BCNF, 4Nf & 5Nf: UNIT-3 Rdbms BCA304 Presenter-Daisy Sharmah
3Nf, BCNF, 4Nf & 5Nf: UNIT-3 Rdbms BCA304 Presenter-Daisy Sharmah
UNIT-3
RDBMS
BCA304
PRESENTER-DAISY SHARMAH
Introduction to 3 Normal Form
rd
• FD set:
{STUD_NO -> STUD_NAME, STUD_NO ->
STUD_STATE, STUD_STATE -> STUD_COUNTRY,
STUD_NO -> STUD_AGE}
• Candidate Key:
{STUD_NO}
Explanation
• For this relation in table, STUD_NO -> STUD_STATE and
STUD_STATE -> STUD_COUNTRY are true.
• So STUD_COUNTRY is transitively dependent on
STUD_NO.
• It violates the third normal form.
• To convert it in third normal form, we will decompose
the relation STUDENT (STUD_NO, STUD_NAME,
STUD_PHONE, STUD_STATE,
STUD_COUNTRY_STUD_AGE) as:
1. STUDENT (STUD_NO, STUD_NAME, STUD_PHONE,
STUD_STATE, STUD_AGE)
2. STATE_COUNTRY (STATE, COUNTRY)
Introduction to BCNF
• Application of the general definitions
of 2NF and 3NF may identify additional
redundancy caused by dependencies that
violate one or more candidate keys.
• Dependencies can still exist that will cause
redundancy to be present in 3NF relations.
• This weakness in 3NF, resulted in the
presentation of a stronger normal form called
Boyce–Codd Normal Form.
• This can be solve by Boyce-Codd Normal Form
(BCNF).
Formal Definition of BCNF
“A relation R is in BCNF if R is in 3NF and every
determinant of a non-trivial functional
dependency in R is a candidate key.”
Explanation to BCNF
• BCNF is the advance version of 3NF. It is
stricter than 3NF.
• A table is in BCNF if every functional
dependency X → Y, X is the super key of the
table.
• For BCNF, the table should be in 3NF, and for
every FD, LHS is super key.
Example
• EMPLOYEE table:
EMP_ID EMP_COUNTRY EMP_DEPT DEPT_TYPE EMP_DEPT_NO
EMP_ID EMP_COUNTRY
264 India
264 India
Example
• EMP_DEPT table:
EMP_DEPT DEPT_TYPE EMP_DEPT_NO
• EMP_DEPT_MAPPING table:
EMP_ID EMP_DEPT
264 Designing
264 Testing
364 Stores
364 Developing
Example
Functional dependencies:
• EMP_ID → EMP_COUNTRY
• EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}
Candidate keys:
• For the first table: EMP_ID
For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}