If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Many to Many between 3 tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-09, 09:40
udaiibhaskar udaiibhaskar is offline
Registered User
 
Join Date: Mar 2009
Posts: 1
Many to Many between 3 tables

Hi All,

I have a problem/don't know the solution... and it is

User has many Projects, Project has many users, and user has multiple roles for a Project.

Eg:

Ram, John are multi skilled persons.

Ram and John are associated with many Projects in a company

Project A has many Users (Ram, Shyam, John, Ryan)

In Project A, Ram takes the roles as 'Configuration Manager and Network Manager' and John takes the roles as 'Developer and System Administer'.

In Project B, Ram takes roles of 'Developer and System Administer' and Ryan takes roles as 'Configuration Manager and Network Manager'.

In Project C, all users are developers.

So we have three tables User, Project and Role

Users are Ram, Shyam, John and Ryan
Projects are Project A, Project B and Project C
Roles are Developer, System Administrator, Configuration manager and Network Manager.

How do we design this situation.

Thanks,
Uday.
Reply With Quote
  #2 (permalink)  
Old 03-29-09, 14:29
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
With a 4th table: UserProjectRoles (UserId, ProjectId, RoleId), with all 2 columns being part of the primary key.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
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

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