If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Database structure help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-09, 15:54
Nigma Nigma is offline
Registered User
 
Join Date: Sep 2009
Posts: 1
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
_______
Reply With Quote
  #2 (permalink)  
Old 09-29-09, 17:41
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Products (ID, Name, price)
Suppliers (ID, Name, Address)
Supplier_Products ( Supplier_ID, Products_ID, Supplier_productcode, stock_level)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On