Many to many relationship

Reply

Join Date: Jan 2009
Posts: 1
Reputation: slen is an unknown quantity at this point 
Solved Threads: 0
slen slen is offline Offline
Newbie Poster

Many to many relationship

 
0
  #1
Jan 1st, 2009
I would like to know how to solve many - to many relationship data.

I have a client and a company table. A client can be an employee or an employer of the company. The employer can associate to more than one company. A company can have many owners or employees.

In this scenario, how do I solve this many to many relationship between these two tables.

Both of the so far have their own unique ID. In this case what I can do to solve this scenario. Does creating another table for both client and company tables make sense?

No idea to this problem.

Thank you.. hope anyone can help me with this. ...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Many to many relationship

 
0
  #2
Jan 1st, 2009
Break the many-to-many relationship into one-to-many and many-to-one
Which means?
create a bridge table Employee_Company (EmployeeID int #, CompanyID int #, Salary float, .....)
Bridge table properties: has composed primary keys (in your case Employee and Company)
- has shared properties which illogical to included in the entities it ties with (in your case salary, work_period, title, etc...)
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC