var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Subtype/supertype help
I have so far created 2 tables:
ITEM_ID ( PK )
ITEM_CATEGORY ( 1=package, 2=product, 3=service )
ITEM_ID ( PK, FK ITEM.ITEM_ID )
SUBITEM_ID ( PK, FK ITEM.ITEM_ID )
This way, I can have a table PACKAGE where I can record packages that can contain 0 or more services and/or 0 or more products from the ITEM table.
Is this a good solution? My next suggestion was to create table for each entity: PRODUCT, SERVICE, PACKAGE.
But how would I create the table PACKAGE so that it stores 0 or more PRODUCT(S) and/or 0 or more SERVICE(S).
i think so
Originally Posted by photo312
There is no reason to split the ITEM table, the ITEM_CETAGORY column should do fine.
However, your description was a bit hard to follow... Are you trying to describe that packages can each have multiple items? If so, you want :
Package (PACKAGE_ID (PK), QUANTITY….)
Item (ITEM_ID (PK), PACKAGE_ID (FK), ITEM_NAME, ITEM_DESCRIPTION, ITEM_COST...)
Hence for every single package you can add multiple items (or no items at all). I may have very well misunderstood your requirements though.
Item table cannot have package id in there, because most items will not be part of any package....