TheWiseGuy
MIS
I am building a database to manage contacts, contracts and students information for a membership-based marital art’s business. I initially thought this would a simple task but, like most things, “the easy part is talking about it, the hard part is doing it”. Anyway, I am getting major brain cramps trying to determine the best way to separate contact names and addresses into individual tables and setup a many to many relationship while also avoiding “orphaned records”.
Here’s what I am trying to do. I need to setup a contact-names table and contact-address tablewith a "many to many" relationship. For example, a particular Contact-Name must have at least one related Contact-address record but may have several related Contact-Address records (i.e.: work address and/or home address). Likewise, a particular Contact-Address must have at least one related Contact-Name record but may have several related Contact-Names records (i.e.: Two students with the same home address).
This gets more complicated when I try to "tie-in" the contact information tables into a MEMBERSHIP-AGREEMENT table. Each MEMBERSHIP-AGREEMENT record must have one “purchaser”; at least one “student” and usually has several “emergency” contacts. In many cases, the purchaser and the student addresses are different. Lets say your entering a new contract, you would need to be able to enter the purchaser’s name and address, the student names and addresses and several emergency-contact names and addresses.
Here are my questions:
1) How would you setup a many to many relationship between the Contact-Name table and Contact-Address table
2) How would you avoid duplicate addresses?
3) How would you avoid orphaned names and/or addresses?
I know this is probably “simple-Simon stuff to most but any suggestions will be appreciated.
Here’s what I am trying to do. I need to setup a contact-names table and contact-address tablewith a "many to many" relationship. For example, a particular Contact-Name must have at least one related Contact-address record but may have several related Contact-Address records (i.e.: work address and/or home address). Likewise, a particular Contact-Address must have at least one related Contact-Name record but may have several related Contact-Names records (i.e.: Two students with the same home address).
This gets more complicated when I try to "tie-in" the contact information tables into a MEMBERSHIP-AGREEMENT table. Each MEMBERSHIP-AGREEMENT record must have one “purchaser”; at least one “student” and usually has several “emergency” contacts. In many cases, the purchaser and the student addresses are different. Lets say your entering a new contract, you would need to be able to enter the purchaser’s name and address, the student names and addresses and several emergency-contact names and addresses.
Here are my questions:
1) How would you setup a many to many relationship between the Contact-Name table and Contact-Address table
2) How would you avoid duplicate addresses?
3) How would you avoid orphaned names and/or addresses?
I know this is probably “simple-Simon stuff to most but any suggestions will be appreciated.