Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining Tables w/ Many-Many Relationship

Status
Not open for further replies.

sk1hotpepr

Technical User
Jul 11, 2003
63
US
I have three tables, one of which needs to be a many-many relationship. I cannot figure out how to do this, since if I don't have a primary key, I can't enter information.
Table1: IDContractor
ID (Primary Key)
Descript

Table2: ProjectCt
ID (Primary Key)
Name (Primary Key)
<other info>

Table3: Team Ct
ProjectNo
Name

What can I do to fix this? Table2 has a combined primary key because there can be a contractor listed under more than one category, so in Table3, I need to be able to allow for the same contractor name to be listed with the project number more than once. Any help would be really appreciated since I'm completely stuck.
 
ContractorTable
cID (autonumber) primary key
contractorName

ProjectTable
pID (autonumber) primary key
projectName

ContractorProjectTable
cpID (autonumber) primary key
cID foreign key
pID foreign key
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top