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
 General SQL Server Forums
 New to SQL Server Programming
 table linking

Author  Topic 

arusu
Yak Posting Veteran

60 Posts

Posted - 2010-11-08 : 11:14:14
Hi I have a table that will hold information about a fish species but then I have another table that holds the different types of bait that are good for a fish. How do I link these table together? The first thing that I thought of is to have a foreign key of fishID in the bait table but I don't want to have the same bait twice in this table just because 2 fish are linked to it. Any suggestions?

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-11-08 : 11:25:24
Its like many to many relationship. You can have another table that holds the relationship between the two.
Go to Top of Page

TimSman
Posting Yak Master

127 Posts

Posted - 2010-11-08 : 11:26:01
Have a table for bait type with an id, your fish species table with an id, and a third table that has species id and bait type id.
Go to Top of Page
   

- Advertisement -