Ricardo, you're asking how to normalise your database. There are links to
some good intro tutorials at http://www.artfulsoftware.com/dbresources.html

PB

-----

> Hi,
>
> I'm having problems trying to figure which is the best way to solve a
design
> :
>
> I'm designing a delivery program with php and mysql, and I'm having
troubles
> with some tables,
> my problem is with the recipes, the recipes are divided into two tables
one
> with a recipe id and description the other detailing the ingredients, of
> each particular recipe, that's where my problem starts because each
> ingredient is not unique and even it appears in many recipes, and another
> thing is every time and item is ordered their correspondent
> recipe ingredients are added , ie. pizza has a code 11, recipe has code 01
> then all the ingredients in the recipe table
> have different ingredient code each, and are related by the recipe code
01,
> then each separate item must be counted,
> and added to the ingredients general daily totals, I mean pizza uses 2
> tomatoes then the general total will show two tomatoes and each other
> ingredient. There are also some combined recipes : Pizza with a special
> sauce, then this item has to query two parts of the same table, say code
12
> is Pizza with a combined sauce of mushrooms and milk, and pineapples, so
> each ingredient must be added to the general total. I need help with the
> design because I don't want to have database anomalies.
>
> Thank you all,
>
> Merry Xmas
> Rick




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to