database design question

James Lance james at thelances.net
Thu Sep 18 11:29:34 MDT 2008


I thought I would see if any of you DBA's out there have any advice.
I'm building an inventory system that deals with inventory tracking,
and also with where inventory is being sold (outlets).  I'm having a
bit of a problem with dealing with outlet over rides.  For example, I
have a pair of shoes and the shoes are available in different sizes.
I'm selling these shoes on amazon.com and ebay.com.  I want my price
to be different for amazon than with ebay.  I'm trying to build the
tables that deal with the outlet differences.  Let me put up a
simplified version of the current database:

Product:
  name
  sku
  price
  manufacturer
  weight
  box-dimensions
  type (can be master or normal.  If master then see options table)
  ...etc...

Product Option:
  FK to Product
  sku
  desc
  value

Now I have the Outlet:

Outlet:
  name
  url
  ...etc...

ProductOutlet:
  FK to Product
  FK to Outlet
  price (overrides default price)
  quantity


Now here comes the part that I'm confused about.  How should I deal
with the Product options?  I've thought of a few ways to deal with
them, but none seem very good.  The ProductOutlet table is a many to
many relationship.  It seems odd to me to add an option table that
refers to a many to many lookup table.

ProductOptionOutlet?
  FK to ProductOutlet (navigating back to product gets tedious, I can
add more FK's)
  FK to ProductOption
  quantity

Does anyone have any suggestions for how I could deal with this?  I'm
really not even certain if I should keep the way that I'm dealing with
products and their options.

Thanks,
James Lance



More information about the PLUG mailing list