andreohnona
New member
- Local time
- Today, 01:49
- Joined
- Feb 10, 2006
- Messages
- 8
Hi,
Context
I am a database novice currently in the process of building an access database to manage production in a manufacturing company.
Simplified Version of Problem
Suppose I wanted to build a database to manage the baking process at a bakery.
Goal is to eventually generate a report from this database that tells the baker i) which raw ingredients to use and ii) gives instructions on baking his cake from the raw ingredients.
I believe I would need the following tables:
tblRawIngredients --> contains all raw ingredients that the bakery purchases (as well as respective properties of those ingredients)
tblCake --> all cakes sold at the bakery (and their respective properties)
tblCakeIngredients --> For each cake, this table stores which Raw Ingredients are needed and in what quantities. This table links tblCake with tblIngredients in some sort of many-to-many relationship
tblCakeInstructions --> For each cake must give me instructions as to how to bake
Specific Question
How do you recommend setting-up tblCakeIngredients?
Given my inexperience, I am not sure which structure would be easiest to work with.
I could think of two options:
Option 1) Each record couples 1 ingredient with 1 cake.
The field list would be :
In order to know the complete ingredient list for "Brownies" we'd have to pull all records where Cake = Brownies
Option 2) Each record gives the complete list of ingredients for a cake. The field list would therefore be
Note that Ingredient_1, Ingredient_2 etc. all link to the same field (primary key) of tblRawIngredients. In this structure, cake could be the primary key.
In order to know the complete ingredient list for "Brownies" we'd pull up the 1 record where Cake = Brownies.
Which structure do you recommend? Why?
I am a little bit stuck on this problem and want to choose the best structure so that I can easily build on this structure and expand/ refine the database.
Thanks a lot!
Andre
Context
I am a database novice currently in the process of building an access database to manage production in a manufacturing company.
Simplified Version of Problem
Suppose I wanted to build a database to manage the baking process at a bakery.
Goal is to eventually generate a report from this database that tells the baker i) which raw ingredients to use and ii) gives instructions on baking his cake from the raw ingredients.
I believe I would need the following tables:
tblRawIngredients --> contains all raw ingredients that the bakery purchases (as well as respective properties of those ingredients)
tblCake --> all cakes sold at the bakery (and their respective properties)
tblCakeIngredients --> For each cake, this table stores which Raw Ingredients are needed and in what quantities. This table links tblCake with tblIngredients in some sort of many-to-many relationship
tblCakeInstructions --> For each cake must give me instructions as to how to bake
Specific Question
How do you recommend setting-up tblCakeIngredients?
Given my inexperience, I am not sure which structure would be easiest to work with.
I could think of two options:
Option 1) Each record couples 1 ingredient with 1 cake.
The field list would be :
Cake (links to tblCake)
Ingredient (links to tblRawIngredients)
QuantityIn order to know the complete ingredient list for "Brownies" we'd have to pull all records where Cake = Brownies
Option 2) Each record gives the complete list of ingredients for a cake. The field list would therefore be
Cake(links to tblCake)
Ingredient_1 (links to tblRawIngredients)
Quantity_1
Ingredient_2 (links to tblRawIngredients)
Quantity_2
Ingredient_3 (links to tblRawIngredients)
Quantity_3
Ingredient_4 (links to tblRawIngredients)
Quantity_4
ETC....Note that Ingredient_1, Ingredient_2 etc. all link to the same field (primary key) of tblRawIngredients. In this structure, cake could be the primary key.
In order to know the complete ingredient list for "Brownies" we'd pull up the 1 record where Cake = Brownies.
Which structure do you recommend? Why?
I am a little bit stuck on this problem and want to choose the best structure so that I can easily build on this structure and expand/ refine the database.
Thanks a lot!
Andre
Last edited: