Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Many to Many RelationShip

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2005-11-24 : 06:41:51
I want to design 2 tables. Doctor and Patient. Doctor can have multiple patients and patient can have multiple doctors. What is best solution for this? Or what is the best approach for many to many relations.

surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-11-24 : 07:08:14
As per my view.
You have to create master tables for Doctor and Patients and your transaction table(3rd) will contain the foreign key of your master tables.
e.q.
Doctor Table(DoctorID,DoctorName,etc......)
Patients Table(PatID,PatName,etc......)
Transaction Table (DoctorID, PatID, field1, field2, etc...)



Surendra
Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2005-11-24 : 07:08:37
Hope this helps

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=26435

Regards
Sachin

Don't sit back because of failure. It will come back to check if you still available. -- Binu
Go to Top of Page

shubhada
Posting Yak Master

117 Posts

Posted - 2005-11-24 : 07:55:17
Have any other solution for this rather than junction table?

shubhada
Go to Top of Page
   

- Advertisement -