table ITEM_TYPE ( ITEM_TYPE_ID numeric -- Primary key. ITEM_TYPE_DESC char -- Description (weapon, armour, ...) ) table ITEM ( ITEM_ID numeric -- Primary key. ITEM_TYPE_ID numeric -- Foreign key into ITEM_TYPE DESC char -- Description. -- More common attributes like weight, value, etc. ) table WEAPON_DETAILS ( ITEM_ID numeric -- Primary/Foreign key. WEAPON_CLASS numeric -- Strength of weapon -- More weapon attributes. ) table ARMOUR_DETAILS ( ITEM_ID numeric -- Primary/Foreign key. ARMOUR_CLASS numeric -- Strength of armour -- More armour attributes. ) table STORE ( STORE_ID numeric -- Primary key -- Store attributes. ) table STORE_INVENTORY ( STORE_ID numeric -- Primary/foreign key *not unique* ITEM_ID numeric -- Foreign key into ITEM. );
Of course, were I to really sit down and take the time to create such a game, I'd probably come up with a totally different idea of how to make the database. ;-)
Abigail
In reply to Re: Efficiency MySQL question
by Abigail-II
in thread [untitled node, ID 308077]
by Samn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |