Normalization 1
Normalization 1
o It states that an attribute of a table cannot hold multiple values. It must hold only single-
valued attribute.
o First normal form disallows the multi-valued attribute, composite attribute, and their
combinations.
EMPLOYEE table:
14 John 7272826385, UP
9064738238
The decomposition of the EMPLOYEE table into 1NF has been shown below:
14 John 7272826385 UP
14 John 9064738238 UP
2)All non-key attributes are fully functional dependent on the primary key, ie., it has no partial
dependencies on the primary key
Partial Dependency
TABLE_Purchase_details
1 1 Delhi
1 3 Chennai
2 1 Delhi
3 2 Kolkata
4 4 Delhi
This table has a composite primary key [Cust_ID, Store _ID]. The non-key attribute
[Purchase Location] only depends on [Store ID], which is only part of the primary key,
ie., it has partial dependency. As per the Second Normal Form there must not be any
partial dependency of any column on primary key.
To bring this table to second normal form, we break the table into two tables, and
now we have the following:
Table_purchase
Cust_ID Store_ID
1 1
1 3
2 1
3 2
4 3
Table_store
Store_ID Purchase_location
1 Delhi
2 Kolkata
3 Chennai
4 Delhi
An attribute that is not part of any candidate key is known as non-prime attribute.
In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and
for each functional dependency X-> Y at least one of the following conditions
hold:
Note – If A->B and B->C are two FDs then A->C is called transitive
dependency.
.
Example-1:
STUDENT
STUD_NO STUD_NAME STUD_STATE STUD_COUNTRY STUD_AGE
1 RAM HARYANA INDIA 20
2 RAM PUNJAB INDIA 19
3 SURESH PUNJAB INDIA 21
4 ANIL UP INDIA 20
FD set:
{STUD_NO -> STUD_NAME, STUD_NO -> STUD_STATE, STUD_STATE ->
STUD_COUNTRY, STUD_NO -> STUD_AGE}
Candidate Key:
{STUD_NO}
For this relation , 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)