On Saturday, January 31, 2004, 9:34:19 AM, you wrote:
t> I am thing I would have to store the id's of the projectmanagers in
t> the client;s table, but how would I do that not know how many a
t> given client will have. is there someway I can store them all in
t> one field of the clients table?
You could have a "projectmanagers" column that stores the IDs in a
list, i.e., "12,45,78".
Or, have a 4 table data structure as follows [table relationships in ()]:
clients
(1 to many)
projects
(1 to many)
projects/managers
(many to 1)
managers
The projects/managers table would basically contain a column for projectsID and
one for managersID, which allows a given manager to be associated with
many projects and a given project to have many managers.
I think this approach would make it easier to find out which projects
and or clients are associated with a given manager.
Sample query based on client ID:
select tblclient.clientname, tblprojmgr.projmgrname
from (tblclient inner join tblproj on tblclient.clientid =
tblproj.projclientid) inner join (tblprojmgr inner join
trelprojprojmgr on tblprojmgr.projmgrid=trelprojprojmgr.projmgrid)
on tblproj.projid=trelprojprojmgr.projid
where tblclient.clientid=1;
Almost identical query based on manager ID:
select tblprojmgr.projmgrname, tblclient.clientname from (tblclient
inner join tb lproj on tblclient.clientid=tblproj.projclientid) inner
join (tblprojmgr inner join trelprojprojmgr on
tblprojmgr.projmgrid=trelprojprojmgr.projmgrid) on
tblproj.projid=trelprojprojmgr.projid
where tblprojmgr.projmgrid=1;
~ Ubqtous ~
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

