User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 428,235 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,301 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser: Programming Forums
Views: 550 | Replies: 1 | Solved
Reply
Join Date: Jul 2008
Posts: 33
Reputation: jakesee is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
jakesee jakesee is offline Offline
Light Poster

Mutual Many to Many relationship

  #1  
Jul 8th, 2008
Hi,

I need a clue on how to design a Many to Many relational database.

For example, I have a products table and a supplier table.

each product can be supplied by many suppliers
each supplier can supply many products

how can I orgranise this data in the tables?

I'm using MySQL.

The only way I can think of now is to create a third table and store the relationships ie.

'product_supplier' table with 2 fields: product_id, supplier_id


Any better ideas to share?

Thanks in advance!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 33
Reputation: jakesee is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
jakesee jakesee is offline Offline
Light Poster

Re: Mutual Many to Many relationship

  #2  
Jul 8th, 2008
After some searching, it appears that a third table is necessary.

I at first thought there could be some other way because in MS Access, you could specify a single field to take multiple values in design view.

But I'm convinced now that it must be using a third table in the background.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Database Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Database Design Forum

All times are GMT -4. The time now is 3:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC