Table with unknown number of columns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

Im very new with Acess 2007 so I have a question.
I have created 2 tables.
The first one is info about the dish.
The second one should contain all the ingrediens for the dish.
But here's my problem...
1 column / ingrediens? Every dish is diffrent. Easy to put the amount in a
column.
1 column with all the ingrediens? Where should I put the amount (1 litres etc)

I have an idea of creating another table with prices on the ingrediens so I
can see the price of the dish. Not now...

I hope you understand my question.

You can answer in swedish to my e-mail: (e-mail address removed)
 
dishes table:
========
dish_name (PK)

ingredients table:
===========
ingredient_name (PK)
ingredient_price

dish_ingredients table:
===============
dish_name (PK)
ingredient_name (PK)
quantity
 
Is this right? If there are 2 ingredients in one dish and 20 in another, does
this still work?
 
It sure will work.

The only issue is that you can't list the same ingredient more than once for
a given recipe. Depending on how you're doing your recipes, that may or may
not be an issue. (I know some people like to group ingredients by
instructions, so that it's possible to have a quarter cup of sugar in one
part of the recipe, and a half cup of sugar in another part)
 
Yes. Table dish_ingredients has two records for one dish and twenty records
for the other. The correct way to handle multiple values in a relational
database is with multiple rows, not multiple columns.
 
Back
Top