Monday, March 12, 2012

Integers & dynamic allocation

Here is what I am trying to do...
I want to goup "members" togethers in a "group."

A table for members and a table for groups.

each containing coluns...

but inside Groups I would like a column that contains ID numbers for the members that be long to that group.

Being that members can belong to multiple groups - I can not use a GroupID in Members - if so I also need a way of it modular.

Obvisiously I am not a very good DB programmer - but I want the least amount of empty/unused space in my tables.

Hope this makes senseyou need a third table (tblMemberGroups) that contains two columns

MemberID and GroupID

this table allow any member to belong to any number of groups and give you a normalized database structure (no wasted space).

you would need to create joins between all 3 tables to determine group membership

members -> tblMemberGroups -> groups

No comments:

Post a Comment