Help with 3NF

• Nov 27, 2008, 08:33
xtrrr
Help with 3NF
Hi there i have been asked to normalise this problem to 3NF:

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

These are the functional dependencies:

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

The solution that i have come up with is as follows:

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

Im just wondering if this is correct?
Thanks
• Nov 27, 2008, 10:54
IBazz
This homework?

Anyway, I can help without doing it for you.

You need to let us see all the columns that you will have or we can't properly 3nf it. you need, for example, to include weights or units of weight/measurement so that 3 eggs doesn't get mixed up with 3 cups/ fl oz and 3 teaspoons of sugar doesn't become 3 cups.
once you get that dealt with ~ and attempt to 3nf it ~ we can help more.

bazz
• Nov 27, 2008, 11:10
xtrrr
All i have is the information i gave at the top.

Yea its homework, but ive done the work jst asking if its right or if not where have i gone wrong etc.
• Nov 27, 2008, 11:15
r937
Quote:

Originally Posted by xtrrr
These are the functional dependencies:

are these FDs given as part of the assignment, or did you make them up?
• Nov 27, 2008, 11:20
IBazz
Well I wish I could teach like Rudy does.

anyway, I'll try (to help).

If you group what you have into clearly separate tables (I make that 4 ~ cooks, recipes, measurements and ingredients) it may help you understand the app of 3nf more easily.

tip:
you don't need a numerical PK. a Composite PK can work here I think.

eg chefs

create table if not exists chefs
( chef_name varchar (64) NOT NULL
, chef_ph_number varcgar(24) NOT NULL
, PRIMARY KEY (checf_name, chef_ph_number)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

I have mentioned a table for measurements. if you decide to do that it would have these values and more perhaps
fl oz
cups
g
oz
kg
tsp
dsp
tbsp
pinch

bazz
• Nov 27, 2008, 11:31
xtrrr
Quote:

Originally Posted by r937
are these FDs given as part of the assignment, or did you make them up?

They were given as part of the assignment, i didnt make them up.

Thanks IBazz will see how it goes now :D
• Nov 27, 2008, 14:22
r937
Quote:

Originally Posted by xtrrr
They were given as part of the assignment, i didnt make them up.

in that case you won't want to introduce any new entities or attributes, like units of measure...