I want to come up with a generic schema (if possible) to use for a number of different events that I am managing. These events can be weddings, birthday parties, etc.
So far I have 3 main tables:
- Contact Table – the usual info like address, phone, etc.
- Events Table – a list of events with some info like date, location, etc.
- EventInfo Table – contains the following fields (not complete but you should get the point):
EventID
ContactID
NumberofAdultsInvited
NumberofChildrenInvited
Responded (yes, no)
NumberofAdultsAttending
NumberofChildrenAttending
This is the table that I’m trying to improve. I am trying to figure out the best way to capture the event data where we want to keep track of data across adults and children.
It seems strange that I need these repetitive fields for adults and children, but I can’t think of any other way. I don’t want to put NumberAdults and NumberofChildren in the contact table because number of children doesn’t necessarily equal numberofChildreninvited (sometimes adults are just invited)
Do you have any ideas how I can clean up this schema or is the above the best that I can get?
NOTE: In the contact table, there is one entry for the family (as it has one address) so there are not fields stored per person within a family.
Here’s how I’d model the database based on the provided info:
EVENTSINVITATIONSCONTACTSIt’s not a good idea to model a contact to be encompassing an entire family. It makes it easier to invite & track things if a contact represents a person rather than a household. After all, a household can have anywhere from 0 to ~18 kids, and may not include a significant other. Each person, assuming teens & up, will have unique contact info (IE: cell phone(s), work numbers, email, etc). This also makes it easier to determine headcount…
The invitations table allows you to summarize invitations & confirmations:
Just need to join to CONTACTS table to determine age and then be able to subcategorize the invitations between adults & children.
FAMILIAL_RELATIONSCONTACT_IDRELATED_CONTACT_IDRELATION_TYPE(parent, child, aunt/uncle, cousin, blacksheep etc)Use this table to rollup to get household members…
CONTACT_METHODSCONTACT_ADDRESS_XREFADDRESSESYou’ll notice I made a one to one relationship with
EVENTSandADDRESSES, while supporting one-to-many contact to addresses. Locations will be relatively static, compared to people. This format would allow you to easily check which event locations are popular, so you could use the information to get better rates in the future.Regarding addresses for the same household: That’s why the ADDRESSES is a separate table – you don’t need to retype it for each person, just associate to the correct address record.