Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Jakhtar
Starting Member
4 Posts |
Posted - 2009-09-18 : 14:34:39
|
I have been reading some of the past topics and articles but cant seem to find anything on what im looking for. It is something that is really basic but it is just kind of bugging me that I might have the database design idea wrong, so I would like to make sure im on the right track as I am fairly new to SQL.Well basically I have a database and in this database it is going to store information about Homeowners. So i have a table named Homeowners which will store the address,phone,alt address,etc.I also have a family table for it to store the spouse and the kids. But my trouble im having is that for the kids if it is more than one kid per family is doing this okay.Child_FName_1Child_LName_1Child_FName_2Child_LName_2Child_FName_3Child_LName_3Is that okay or is there a better way i could be approaching this. Thanks in advance for your help I know the question is probably simply but I am new to this and just want to learn the right way. |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-09-18 : 15:19:39
|
As soon as you starting needing to add columns for things like (address vs. alt address) and (home phone vs. cell phone, vs. fax number) and the same applies for child_1, _2, _3, etc... that is an indication that you need to break that info out to a different table. so a simple db model example for people and phone numbers is:- person (personid, fName, Lname)- phone (phoneid, phoneNumber, phoneTypeID)- personPhone (personid, phoneID)- phoneType (phonetypeID, phoneTypeDescription)This is the basic principal of database normalization.this way you don't have to restructure your model when the next type of phone gets invented - you just need to add rows to phonetype and personPhone.Keep that principal in mind for your model where maybe a person can own multiple homes, a home can be owned by multiple people, a family can have (many) more than 3 childred , and of course a child even have multiple sets of parents.Be One with the OptimizerTG |
|
|
Jakhtar
Starting Member
4 Posts |
Posted - 2009-09-18 : 17:22:46
|
Cool thanks for the help let me see what I can come up with now seems like it makes more sense that way.Thanks again for help |
|
|
|
|
|
|
|