DBMS Unit 3
DBMS Unit 3
42 abc CO A4
43 pqr IT A3
44 xyz CO A4
45 xyz IT A3
46 mno EC B2
47 jkl ME B2
42 abc 17
43 pqr 18
44 xyz 18
42 abc 17
43 pqr 18
44 xyz 18
Introduction of Database
Normalization
Normalization is the process of minimizing redundancy from a relation or
set of relations. Redundancy in relation may cause insertion, deletion, and
update anomalies. So, it helps to minimize the redundancy in
relations. Normal forms are used to eliminate or reduce redundancy in
database tables.
Normal Description
Form
2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully
functional dependent on the primary key.
4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no
multi-valued dependency.
5NF A relation is in 5NF. If it is in 4NF and does not contain any join
dependency, joining should be lossless.
Example :
ID Name Courses
------------------
1 A c1, c2
2 E c3
3 M C2, c3
In the above table, Course is a multi-valued attribute so it is not in 1NF.
Below Table is in 1NF as there is no multi-valued attribute:
ID Name Course
------------------
1 A c1
1 A c2
2 E c3
3 M c2
3 M c3
{Note that, there are many courses having the same course fee. } Here,
COURSE_FEE cannot alone decide the value of COURSE_NO or
STUD_NO; COURSE_FEE together with STUD_NO cannot decide the
value of COURSE_NO; COURSE_FEE together with COURSE_NO
cannot decide the value of STUD_NO; Hence, COURSE_FEE would be a
non-prime attribute, as it does not belong to the one only candidate key
{STUD_NO, COURSE_NO} ; But, COURSE_NO -> COURSE_FEE, i.e.,
COURSE_FEE is dependent on COURSE_NO, which is a proper subset
of the candidate key. Non-prime attribute COURSE_FEE is dependent on
a proper subset of the candidate key, which is a partial dependency and
so this relation is not in 2NF. To convert the above relation to 2NF, we
need to split the table into two tables such as : Table 1: STUD_NO,
COURSE_NO Table 2: COURSE_NO, COURSE_FEE
Candidate Key:
{STUD_NO}
For this relation in table 4, 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:
STUDENT (STUD_NO, STUD_NAME, STUD_PHONE, STUD_STATE, STUD_AGE)
STATE_COUNTRY (STATE, COUNTRY)