Prepare for your Next Interview
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 ...
|
|||
|
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 |
| Sponsored Links |
|
|||
|
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
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 attributesSo 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
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| 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 |