View Full Version : Relationship Help


kaseyq
10-30-2010, 04:07 PM
Hello,
I have a real problem. I am creating a database for our child care at my job and I need help on how to to relate the tables. I have the following tables:
Parents, Child, Activities, Billing, Payments, Payment Methods, Sites, and Employees. What is your suggestions on relating the tables? I did set it up where everything was attached to the parents and it wasn't coming out right. Help?
Thank you,

Kaseyq

What I had related was:
Parent ID - Child (Parent ID)
Child ID - Billing (Child ID)
Activity ID - Billing (Activity ID)
Parent ID - Payments (Parent ID)
I didn't have the lookup in the payments

The problem is when the after school people key this they usually have more than one item to bill, so when they put the payment in they would have to put the payment in more than once and relate the receipt to both of the billing items. I think I did figure it out, but any suggestions?

BrainKing
10-31-2010, 05:16 AM
Usually you need to relate the tables WITHOUT any data in the tables first.

jdraw
10-31-2010, 06:39 AM
I suggest you do some research on Business Rules, then create a model of the things involved in "your business". See if your model will support your business rules - adjust accordingly. It may be the rule that is not correct, or it may be a relationship that is incorrect.

I'd also suggest you define/describe each of the things of interest to your business. Clear definitions will be of major assistance when you find relationships/rules that don't quite work.

See http://www.databaseanswers.org/data_models/index.htm for some existing models and go the business rules/user requirements to see the sorts of things that the model ( and eventually the database) must support.

Another good source of info is http://allenbrowne.com/casu-22.html
Good luck.

Dumbfounded
10-31-2010, 09:55 AM
You need to make sure that they all have ID's in them. In your table for the child, it needs a unique ID, then in the table for the parents, you would have a column titled childID, for instance - that way the relationship is made using those ID's, thus leaving the child to be connected to the correct parent.

Hope that helps.

kaseyq
10-31-2010, 11:52 AM
Thank you for your help. I realized I must relate the payment to the billing or it will display some funny results. Thanks for all your posts.
Kasey

kaseyq
10-31-2010, 11:54 AM
Thanks for the post. I did just find the models the other day and that is an awesome website. The allen browne website I have known about for a while.
Thanks