Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-2007, 07:50 AM
Clayton
 
Posts: n/a
Default NEED HELP: Database structure

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-05-2007, 12:12 PM
Captain Paralytic
 
Posts: n/a
Default Re: NEED HELP: Database structure

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:06 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.