Geeks Talk

Prepare for your Next Interview




2nd and 3rd normal forms

This is a discussion on 2nd and 3rd normal forms within the Database General forums, part of the Databases category; Can someone explain 2nd and 3rd normal forms? I have been through some literature. But I am still unclear. Also, I am not sure what exactly is meant by functional ...


Go Back   Geeks Talk > Databases > Database General

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-12-2008
Junior Member
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
vaishali1763 is on a distinguished road
2nd and 3rd normal forms

Can someone explain 2nd and 3rd normal forms? I have been through some literature. But I am still unclear.

Also, I am not sure what exactly is meant by functional dependency and transitive dependency. Can someone elaborate on this?

Thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-14-2008
Junior Member
 
Join Date: Dec 2006
Location: Bhubaneswar
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
jitudash is on a distinguished road
Re: 2nd and 3rd normal forms

There is a sequence to know the concepts in regard to 2nf and 3nf and that is as follows
  1. Functinal dependecy(FD)
  2. Full and partial functional dependency
  3. Prime and Non-prime attributes
  4. 2NF
  5. Transitive dependency
  6. 3NF
FD:Suppose there are 2 sets of attribute X and Y of a relation R and Y is said to be functionally dependent on X or functionally determines Y iff
t1[X]=t2[X] then t1[Y] must be equal to t2[Y].where t1 and t2 are two different tuples or rows of R.Now let me illustrate it through an example.
Consider there is a table with the following attributes
Designation Pay_scale Nameand
Designation->Pay_scale
here the arrow mark denotes that Designation functionally determines Pay_scale
We can say Designation is X attribute and Pay_scale is Y attribute.Now let me put some values into it
Designation Pay_scale Name
Lecturer 8000.00 Akshaya
Professor 20000.00 M.Prasad
Asst_prof 16000.00 N.patra
Lecturer 8000.00 Soma
Asst_prof 16000.00 M.Dash

Here in the above table u can see the values of Designation in (row1 and row4) and (row3 and row5) are same and so is the values of Pay_scale in the corressponding rows.But same is not true with Name attribute.This is all because Designation->Pay_scale

Full and Partial functional dependency:

A functional dependency X->Y is a full functional dependecy ,if removal of any attribute A from X means that the dependency doesn't hold any more that means (X-{A}) doesn't functionally determines Y.

Now consider the a table with following attributes and given FDs
SSN,PNUMBER,HOURS,ENAME,PNAME,PLOCATION
and
SSN->ENAME
PNUMBER->PNAME,PLOCATION
SSN,PNUMBER->HOURS

and SSN,PNUMBER combinely forms primary key for the table.

Here I would like to tell you primary key can determine all other attributes of a given table
Now in the above table even if you remove PNUMBER from Primary key,ENAME can be easily determined by SSN because SSN->ENAME(given) dependencies.And if SSN is removed From Primary key then also PNAME,PLOCATION can be easily determined by PNUMBER.This table doesn't satisfy the concept of full functional dependecy.
2NF:
Defn:A relation scheme R is in 2NF if every nonprime attribute A in R is fully functionally dependent on the primary key of R.
Now What is non prime attribute?
The attribute which is not a part of any candidate key.
Refer to the aforementioned table.All other attribute except SSN,PNUMBER
are non prime attributes
So this table is not in 2NF
If you break the above the above table into three different tables as follows then the problem would automatically solved
  • SSN,PNUMBER,HOURS (SSN,PNUMBER is the primary key for this relation)
  • SSN,ENAME(SSN is the primary key for this relation)
  • PNUMBER,PNAME,PLOCATION(PNUMBER is the primary key for this relation)
Today I cannot explain you transitive dependecy and 3NF as I have got some other works in my hand.
Reply With Quote
Reply

  Geeks Talk > Databases > Database General


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
how to alter normal column to identitycolumn boreddy SQL Server 2 07-18-2008 07:55 AM
Normal View, Materialised View and Bitmap Index Geek_Guest Oracle 3 05-28-2008 12:59 AM
What is the difference between Normal mode and Fast mode? suneetham QTP 4 03-28-2008 03:25 AM
Forms 5 and Forms 10g Geek_Guest Oracle 1 08-15-2007 11:37 AM
Normal Variable and the Comp-3 Variable in Cobol Geek_Guest MainFrame 0 07-04-2007 09:47 PM


All times are GMT -4. The time now is 07:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved