Im currently working on a site which will contain a products catalog. I am a little new to database design so I\'m looking for advice on how best to do this. I am familiar wit
Now, this all seemed fine and dandy, until I realized that the category "wood" would also be used under propeller -> airboat -> (wood). This would mean, that "wood" would have to be recreated every time I want to use it under a different parent. This isn't the end of the world, but I wanted to know if there is a more optimal way to go about this.
What if you have an aircraft that is wood construction, but the propeller could be carbon fiber, fiberglas, metal, graphite?
I'd define a table of materials, and use a foreign key reference in the items table. If you want to support more than one material (IE: say there's metal re-inforcement, or screws...), then you'd need a corrollary/lookup/xref table.
MATERIALS_TYPE_CODE
tableMATERIALS_TYPE_CODE
pkMATERIALS_TYPE_CODE_DESC
PRODUCTS
tablePRODUCT_ID
, pkMATERIALS_TYPE_CODE
fk IF only one material is ever associatedPRODUCT_MATERIALS_XREF
tablePRODUCT_ID
, pkMATERIALS_TYPE_CODE
pkI would also relate products to one another using a corrollary/lookup/xref table. A product could be related to more than one kitted product:
KITTED_PRODUCTS
tablePARENT_PRODUCT_ID
, fk CHILD_PRODUCT_ID
, fk ...and it supports a hierarchical relationship because the child could be the parent of soemthing else.