Results 1 to 3 of 3

Thread: DB Modeling 101 - best practice?

  1. #1
    Join Date
    Sep 2008
    Posts
    1

    DB Modeling 101 - best practice?

    Say I have the following tables & scenario:

    Books
    Book_ID
    Book_Title
    Book_Price

    Stores
    Store_ID
    Store_Name

    Books_Stores
    Book_ID
    Store_ID

    95% of the time, all stores will sell the book at the "list" price (Book_Price). However, there are some times when a store will sell the book at a different price.

    Would I create something like a Books_Stores_Price field in Books_Stores that would contain every store's price (seems like I would be storing a lot of duplicative data)? Or is there some more elegant way to store just the exceptions, and ensure that on any given query that the default price in the Books table or the exception store price gets returned?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2008
    Posts
    29
    your subject line was misleading.. I thought it was something like a FAQ or a tutorial

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Create a table for price exceptions only for the store.

Posting Permissions

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