Sie sind auf Seite 1von 6

Normalization or data normalization is a process to

organize the data into tabular format (database


tables).why we have to normalize the given table
and fragment into small tables.

Third normal form(3NF)


A relation is said to be in 3NF if and only if
It is already in 2NF(every non-prime
attribute is fully dependent on the primary
key)
Every non-prime attribute is nontransitively dependent on the primary key

Example:
Student-hostel:
S-ID
11f

S-NAME
Rowdy

Age

SEX

Hostel-name

22

Male

Red house

12f

Munni

18

Female

Green house

13f

Singham

25

Male

Red house

14f

Sila

19

female

Green house

Functional dependency:
S-ID ->S-NAME
S-ID ->Age
S-ID -> SEX
S-ID ->Hostel-name and also
sex ->Hostel-name

The last dependency was not originally specified but we have derived
and is called as transitive dependency. So to get 3NF we have to
eliminate this transitive dependency.
Suppose:
A -> B, B ->C and also A ->C

From the above table we can make 3NF as:


Student:
S-ID

Age

SEX

22

Male

Munni

18

Female

13f

Singham

25

Male

14f

Sila

19

female

11f
12f

S-NAME

hostel:

Rowdy

SEX

Hostel-name

Male

Red house

Female

Green house

Example of 3NF(normalization employee-department into 3NF relation)


Employee-department relation
Employee(ename, ssn, Bdate, address, dnumber)
Department(dnumber,dname,dmgr-ssn )

employee-department table

ename

ename

ssn

ssn

bdate

address

bdate address

dnumbe
dname
r

dnumbe
r

Dmgrssn

dnumbe
dname
r

Dmgrssn

another example, imagine that we have the


following used car parts stores tables where the
unit price varies depending on the state of the
piece and where Order Number is our primary key.
Order Number

Customer Number

Unit price

quantity

total

410

Rs.200

Rs. 400

333

90

10

900

543

310

310

765

240

20

480

Functional dependency:
Order number -> customers Number
orderNumber ->unit price
orderNumber ->quantity
orderNumber -> total
Unitprice,quantity -> total

So our resulting table in 3NF would


look like :
Order Number

Customer Number

Unit price

quantity

410

Rs.200

333

90

10

543

310

765

240

20

Das könnte Ihnen auch gefallen