I am working on a db for a chemical manufacturing business. We primarily want to be able to determine the cost of each recipe, and determine which finished products contain any given raw material (so that when there is a price increase, we can determine which products will be affected). We will also run tons of query based reports.
Each finished product has its own recipe. Each recipe has four possible batch sizes (5, 55, 275 gal or 45,000 lb tanker, corresponding to four container sizes).
How would I best keep four separate recipes (the amount of each ingredient changes based on batch size) but not require four separate finished product and/or recipe names?
Here are the tables I have set up:
tblFinishedProduct
FinishedProductID (PK)
FinishedProductName
FinishedProductCategoryID (precipitant, coagulant, etc)
tblRecipe
RecipeID (PK)
FinishedProductID (FK)
BatchSizeID (FK) (# gallons finished product, also container size)
RawMaterialID (FK)
RawMaterialSequence (order of ingredient)
RawMaterialQuantity (in pounds or gallons)
tblRawMaterial
RawMaterialID (PK)
RawMaterialName
PerUnitCost
PerUnitFreightCost
UnitofMeasureID (FK)
SupplierID (FK)
tblCategory
CategoryID (PK)
CategoryName
tblBatchSize
BatchSizeID (PK) (and FK to Container size)
BatchSize
tblUnitofMeasure
UnitofMeasureID (PK)
UnitofMeasure (pounds or gallons)
tblContainer
ContainerID (PK)
ContainerSize (FK to BatchSizeID)
ContainerWeight
ContainerCost
SupplierID (FK)
tblSupplier
SupplierID (PK)
SupplierName, SupplierAddr, City, Contact, etc.
tblFinishedProductDetails
FinishedProductDetailsID (PK)
FinishedProductID (FK)
FinishedProductCorrosivity, Weight, Density, SpecificGravity, pH, etc.
Thanks,
Pam
Each finished product has its own recipe. Each recipe has four possible batch sizes (5, 55, 275 gal or 45,000 lb tanker, corresponding to four container sizes).
How would I best keep four separate recipes (the amount of each ingredient changes based on batch size) but not require four separate finished product and/or recipe names?
Here are the tables I have set up:
tblFinishedProduct
FinishedProductID (PK)
FinishedProductName
FinishedProductCategoryID (precipitant, coagulant, etc)
tblRecipe
RecipeID (PK)
FinishedProductID (FK)
BatchSizeID (FK) (# gallons finished product, also container size)
RawMaterialID (FK)
RawMaterialSequence (order of ingredient)
RawMaterialQuantity (in pounds or gallons)
tblRawMaterial
RawMaterialID (PK)
RawMaterialName
PerUnitCost
PerUnitFreightCost
UnitofMeasureID (FK)
SupplierID (FK)
tblCategory
CategoryID (PK)
CategoryName
tblBatchSize
BatchSizeID (PK) (and FK to Container size)
BatchSize
tblUnitofMeasure
UnitofMeasureID (PK)
UnitofMeasure (pounds or gallons)
tblContainer
ContainerID (PK)
ContainerSize (FK to BatchSizeID)
ContainerWeight
ContainerCost
SupplierID (FK)
tblSupplier
SupplierID (PK)
SupplierName, SupplierAddr, City, Contact, etc.
tblFinishedProductDetails
FinishedProductDetailsID (PK)
FinishedProductID (FK)
FinishedProductCorrosivity, Weight, Density, SpecificGravity, pH, etc.
Thanks,
Pam