Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
motix
Starting Member
1 Post |
Posted - 2009-11-04 : 10:31:33
|
Hello. I have to normalize a tables in database, I would like to ask anyone experienced with databased if below normalization is correct for 1F,2F,3F. thanks for replyNormalizationCooking( rID, rname, ( ingredientID, ingredientName, amount), cookID, cookName, cookPhNumber);cookID -> cookNamecookID -> cookPhNumber?rID -> rname?rID -> cookID?ingredientID -> ingredientName1NF:RECIPE:rID – primary key rNameINGREDIENT:ingredientID – primary keyingredientNameamountCOOKcookID – primary keycookNamecookPhNumberI created separate table for each group of related data and identified each row with unique data – primary key.2NF:RECIPErID – primary keyrnameINGREDIENTingredientID – primary keyingredientNameamountCOOKcookID – primary keycookNameCOOKPHcookID – primary keycookPhNumber3NF:RECIPErID – primary keyrnameINGREDIENTingredientID – primary keyingredientNameamountCOOKcookID – primary keycookNameCOOKPHcookID – primary keycookPhNumberCOOKRECIPEcookID – primary keyrID |
|
krishnarajeesh
Yak Posting Veteran
67 Posts |
Posted - 2009-11-06 : 13:37:30
|
Hello,In the 3rd normal form the below structure is enough.INGREDIENTingredientID, -> Primary KeyingredientName,amountRECIEPErID, -> Primary KeyrnameCOOKcookID, -> Primary KeycookName, cookPhNumberCOOKRECIEPEcookID -> Composite keyrID -> Composite keyNote1 : for COOKRECIPE table, we should have a composite key, since the same cook will have multiple recipe.Note2 : for COOK table we can put all information like cookname & cookPhNumber. This is becasue each item can be completly defined by the primary key cookID.Thanks,Krishnawww.SQLServer.in |
|
|
|
|
|
|
|