| |
|
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.
|
 |
|

04-14-10, 03:07
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
|
How to add an extra element to my erd?
|
|
Hello,
I have an access database which is used to store individual users (tblusers) visits (tblvisits) to a library. One user can have many visits, and one visit may involve many activities (tlbactivities).
I would like to add the option of allowing a Group of people (tblgroups) to make a visit to a library, but the part which I cannot get right is that an existing individual user may be a member of many groups, and one group may have many members. So if an individual comes for a visit with a group I need to capture that group visit, but also the induvidual user who was part of that group.
I am not sure how to add a possible groups table, should it be related to tblusers, or tblgroups, or both? I have attached my erd if anyone can offer any suggestions.
Thank you 
|
|

04-14-10, 13:20
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Any thoughts or suggestions?
|
|

04-14-10, 13:59
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
|
|
|
|
so a person can visit the library in their own capacity or as a member of a group, presumably you don't know if all members of a group will visit the library in the same visit.
so it sounds like you need intersection tables to associate which groups a member belongs to
that intersection is usually the PK of the intersecting tables combining to form the PK of the intersected table
the you need intersection tables between a visit and individuals. arguably you could store the group as part of the visit table as there can only be one group in any one visit
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
|
|

04-14-10, 15:54
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Quote:
|
so a person can visit the library in their own capacity or as a member of a group, presumably you don't know if all members of a group will visit the library in the same visit.
|
Yes that is correct.
So am I correct in thinking I should create an intersection table between tblusers and tblgroups, using userID(pk) and groupID(pk) from the two table as the new intersection tables primary keys?
And yes, one group can make one visit at a time.
And then, is the new intersection table (lets say it is called 'tblBelongsTo') linked to my existing visits table?
It is getting me so confused!
|
|

04-14-10, 17:39
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Could you explain again how many intersection tables I need, and where and to they are joining to? 
|
|

04-15-10, 03:19
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
|
|
an intersection table is used when you need to model a many to many relationship
Google
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
|
|

04-15-10, 03:35
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Yes, do I need one or two intersection tables?
Firstly, an intersection table between groups and indivials? This new intersection table links to the visits table? Is that correct?
And then secondly an intersection table between visits and individuals? This intersection table also then links to visits table Is that correct?
|
|

04-15-10, 11:46
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Am I on the right track with this new ERD? If you could have a look and let me know I would appreciate it very much 
|
|

04-15-10, 15:00
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
I don't think you need to separate visit and beneficiaryVisit, because they are they describe the same thing.
|
|

04-15-10, 15:00
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
Some thunklations:
Is a beneficiary what was once a user? If so, can a user visit if they are not in a group?
Imagine tblBeneficiaryGroups contains one row and one row only:
And tblBeneficiaryGroupVisits contains one row and one row only:
would that be valid?
If a beneficiarygroup visits more than once do you need to record all visits?
|
|

04-15-10, 15:21
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Sorry, yes a Beneficiary is a User, call them what you want, I forgot I may have changed that field name.
Yes a User can visit when not in a group.
All visits by an individual need to be recorded, and all visits by a group need to be recorded also.
I have just realised that I may not have explained the group visit clearly, and this may confuse things more, but I need to mention it: One user can visit as a representetive of a whole group. What I mean is a Group visit may infact only have had one User making that visit on behalf of a group. (A group visit may be defined by a single user arriving at a library on behalf of a group to do photocopying for that group)
Now my head really hurts!
|
Last edited by moss2076; 04-15-10 at 15:28.
|

04-15-10, 15:29
|
|
Registered User
|
|
Join Date: Apr 2010
Posts: 24
|
|
Quote:
Originally Posted by moss2076
I have just realised that I may not have explained the group visit clearly, and this may confuse things more, but I need to mention it: One user can visit as a representetive of a whole group. What I mean is a Group visit may infact only have had one User making that visit.
|
I wouldn't worry about that. If they are acting as a single rep for a group, count them as a group, since they arn't there on a single user capacity.
Just my 2 cents
__________________
DevilsAdvocate
------------------------
The elephant in the room
------------------------
Ordo ab chao
|
|

04-15-10, 15:44
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Quote:
Originally Posted by DevilsAdvocate
I wouldn't worry about that. If they are acting as a single rep for a group, count them as a group, since they arn't there on a single user capacity.
Just my 2 cents
|
Thankyou for your input 
|
|

04-15-10, 16:56
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
Quote:
Originally Posted by moss2076
Yes a User can visit when not in a group.
|
Ok - so which table would you record this in?
The other questions still stand too
Quote:
Originally Posted by moss2076
Now my head really hurts!
|
Jolly good - that means things are going swimmingly.
|
|

04-15-10, 17:11
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 344
|
|
Quote:
Originally Posted by pootle flump
Ok - so which table would you record this in?
|
I think I would record this in the single visits table, and have a field to show wether the visit was part of a group or not? A yes/no combo field.
In response to your other question -
Quote:
Imagine tblBeneficiaryGroups contains one row and one row only:
Code
1 1
And tblBeneficiaryGroupVisits contains one row and one row only:
Code:
2 2 2
would that be valid?
If a beneficiarygroup visits more than once do you need to record all visits?
|
yes I think that would be valid and yes I need to record all visits.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|