Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003

    Unanswered: what is the best way to set this up?

    hi everyone,

    i am trying to model some tables for an ecommerce database. there is a manufacturers table. manufacturers have products (products table) and products have SKUs (SKU table). there are actually more levels than this, but to simplify the problem, we'll stick with that.

    now i need to add pricing rules. i need to be able to add a pricing rule to a manufacturer (such as 10% off all prices), which would affect any products and SKUs under this manufacturer. i also need to be able to add pricing rules at the product level (which would affect all SKUs under the product) and SKU levels. there also has to be a priority, for example, if a SKU has a pricing rule, that rule should be used before the rule for the manufacturer.

    what is the best way to set this up? so far i have come up with having a pricing rules table at each level, but it seems like the queries would be horrible. any advice?

    thanks for your help.

  2. #2
    Join Date
    Jul 2003
    San Antonio, TX
    Right off the bat:

    tblManufacturers (ManID, ManName, etc.)
    tblProducts (ProductID, ManID, etc.)
    tblSKUs (SKUID, ProductID, Cost, BasePrice)
    tblEntityTypes (EntityTypeID, EntityWeght, EntityType)
    tblPriceRules (PriceRuleID, EntityID, EntityTypeID, PricePercent, PricePercentIndicator)

    This structure does not support a permanent storage of the resulting price alteration, but it can be easily implemented.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts