![]() |
| |||
| Hi all, I need some help regarding a database structure! Here is the scenario: Partners Table -partnerID (PK) -partnerName -partnerAddress ---------------------------------------- Projects Table -projectID -projectName -projectDuration ---------------------------------------- Associations Table -assocID -assocPR_ID (FK) -assocPRO_ID (FK) So basically a partner can have many projects and a project can have many partners. I'm using the Associations Table as a link between the two! Is that correct or there is a better way? Thanks in advanced, Clayton |
| |||
| On 5 Dec, 08:50, Clayton <clayton.cu...@gmail.com> wrote: > Hi all, > > I need some help regarding a database structure! Here is the > scenario: > > Partners Table > > -partnerID (PK) > -partnerName > -partnerAddress > > ---------------------------------------- > > Projects Table > > -projectID > -projectName > -projectDuration > > ---------------------------------------- > > Associations Table > > -assocID > -assocPR_ID (FK) > -assocPRO_ID (FK) > > So basically a partner can have many projects and a project can have > many partners. I'm using the Associations Table as a link between the > two! Is that correct or there is a better way? > > Thanks in advanced, > Clayton This is the right way for a many to many table. However instead of the assocID, I would recommend Associations Table -assocPR_ID (FK) -assocPRO_ID (FK) with a composite primary key of both the columns, plus possibly an index on the column that is not teh first in the PK. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |