Unit 3
Unit 3
DESIGN
• Anomalies in DBMS
• There are three types of anomalies that occur when the database is not
normalized. These are – Insertion, update and deletion anomaly .
4 Head JBL
phone
Products Brand table:
That's why we need to move the EMP_CITY and EMP_STATE to the new
<EMPLOYEE_ZIP> table, with EMP_ZIP as a Primary key.
Unit 2 Relational Database Design 22
EMP_ID EMP_NAME EMP_ZIP
201010 UP Noida
02228 US Boston
60007 US Chicago
06389 UK Norwich
462007 MP Bhopal
Unit 2 Relational Database Design 23
Boyce Codd normal form (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: Let's assume there is a company where employees work in more than one
department. EMPLOYEE table:
21 Computer Dancing
21 Math Singing
34 Chemistry Dancing
74 Biology Cricket
59 Physics Hockey
The given STUDENT table is in 3NF, but the COURSE and HOBBY are two independent entity.
Hence, there is no relationship between COURSE and HOBBY. In the STUDENT relation, a
student with STU_ID, 21 contains two courses, Computer and Math and two hobbies,
Dancing and Singing. So there is a Multi-valued dependency on STU_ID, which leads to
unnecessary repetition of data.
So to make the above table into 4NF, we can decompose it into two tables:
STU_ID COURSE
21 Computer
21 Math STUDENT_HOBBY
34 Chemistry
STU_I HOBBY
74 Biology D
59 Physics 21 Dancing
21 Singing
34 Dancing
74 Cricket
59 Hockey