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.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Help with Normalization

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 reply

Normalization

Cooking( rID, rname, ( ingredientID, ingredientName, amount), cookID, cookName, cookPhNumber);

cookID -> cookName
cookID -> cookPhNumber
?rID -> rname
?rID -> cookID
?ingredientID -> ingredientName

1NF:

RECIPE:
rID – primary key
 rName

INGREDIENT:
ingredientID – primary key
ingredientName
amount

COOK
cookID – primary key
cookName
cookPhNumber

I created separate table for each group of related data and identified each row with unique data – primary key.

2NF:

RECIPE
rID – primary key
rname

INGREDIENT
ingredientID – primary key
ingredientName
amount

COOK
cookID – primary key
cookName

COOKPH
cookID – primary key
cookPhNumber

3NF:

RECIPE
rID – primary key
rname

INGREDIENT
ingredientID – primary key
ingredientName
amount

COOK
cookID – primary key
cookName

COOKPH
cookID – primary key
cookPhNumber

COOKRECIPE
cookID – primary key
rID

krishnarajeesh
Yak Posting Veteran

67 Posts

Posted - 2009-11-06 : 13:37:30
Hello,

In the 3rd normal form the below structure is enough.

INGREDIENT
ingredientID, -> Primary Key
ingredientName,
amount

RECIEPE
rID, -> Primary Key
rname

COOK
cookID, -> Primary Key
cookName,
cookPhNumber

COOKRECIEPE
cookID -> Composite key
rID -> Composite key

Note1 : 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,
Krishna
www.SQLServer.in
Go to Top of Page
   

- Advertisement -