C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Boyce Codd normal form (BCNF)
Example: Let's assume there is a company where employees work in more than one department. EMPLOYEE table:
In the above table Functional dependencies are as follows: EMP_ID → EMP_COUNTRY EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO} Candidate key: {EMP-ID, EMP-DEPT} The table is not in BCNF because neither EMP_DEPT nor EMP_ID alone are keys. To convert the given table into BCNF, we decompose it into three tables: EMP_COUNTRY table:
EMP_DEPT table:
EMP_DEPT_MAPPING table:
Functional dependencies: EMP_ID → EMP_COUNTRY EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO} Candidate keys: For the first table: EMP_ID Now, this is in BCNF because left side part of both the functional dependencies is a key.
Next TopicDBMS 4NF
|