Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Unanswered: Database structure help

    Hi,

    I have a database with these tables (amongst others) which i've simplified a little below to help with the question.

    Products (ID, Name, price, stock_level)
    Suppliers (ID, Name, Address)

    A products can be sourced from multiple suppliers.

    So as it stands, I generate an order for a specific supplier and the order basically list the Product Name along with qty I require from them. They then use the product name to manually pick the product from their warehouse.
    I want to improve the current system by storing the suppliers own productID. However, I can't store this in the products table, as each product can be sourced from different suppliers and each supplier will have a different productID for the same product.

    Can anyone suggest how this should be stores in my database?

    Thanks,
    Anand
    _______

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Products (ID, Name, price)
    Suppliers (ID, Name, Address)
    Supplier_Products ( Supplier_ID, Products_ID, Supplier_productcode, stock_level)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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