At first, I agreed with you, but now I think I may have either seen the light, or misunderstood the question. I'm gonna assume that I understood you perfectly, for the sake of argument. So, here goes.
I'm assuming that a Product is something that is reusable, or that has a quantity. I'm gonna assume that you guys are making furniture, so I will say that a product is a 3/4" steel caster, product id #1, part number "XYZZY4".
Now, if you have a job that requires you to build, a couch, you need the part table to link to the product table. Because that caster is going to have to be used on multiple jobs, and you are going to need to have multiple parts linked to that job.
Think of it this way, the jobOrder is the invoice, the parts table is the list of line items on the invoice (for the parts, although, you could theoretically make a Product for 1hr of labor and throw it in there too.) or the list of stuff in your shopping cart. The Products table is the catalogue of what you sell.
So, here's the quick example
jobOrder :
{
jobId = 1, jobName = "Couch for Joe"
}
Parts {
partId = 1, jobId = 1, productId = 1, qty = 4
partId = 2, jobId = 1, productId = 4, qty = 1
partId = 3, jobId = 1, productId = 3, qty = 8
partId = 4, jobId = 1, productId = 2, qty = 1
}
Products {
productId = 1, productName = "3/4 inch steel caster"
productId = 2, productName = "Fluffy stuffing"
productId = 3, productName = "Framing wood"
productId = 4, productName = "Cloth covering"
}
Am I making any sense?
|