Hi every one! I'm back to the well of wisdom with another question. I hope someone can shed a little light for me.
It is my understanding, in a relational DB, that one of the main rules for normalization is to eliminate repetitive information. Another advantage of a relational DB is to avoid maintaining multiple tables with the same data through the use of child tables and relationships.
Here is my problem and question:
I am creating an order / billing application for a small manufacturing business.
I need to have the ability for some of my customers to
have the possibility of multiple ship to addresses.
I first set my customer table up with this idea
Cust1 ABC Corp Bill_to: Same
Cust2 XYZ Corp store #1 Bill_to: XYZ Corp
Cust3 XYZ Corp store #2 Bill_to: XYZ Corp
Cust4 XYZ Corp store #3 Bill_to: XYZ Corp
and so on.
Then I spotted the repeating info an thought of a one-to-many table.
For instance XYZ is the main customer and the billing would all go to:
XYZ Corp
123 Main
This City USA
But I can ship to:
XYZ Corp Store in Main
XYZ Corp Store in California,
XYZ Corp Store in Colorado........... and so on.
This eliminates the problem of repeating BUT doesn't this also introduce the need to maintain to sets of data when I have customers that the ship_to and bill_to are the same?
So now my question: Can I (Would I want to?)link a partent table back on itself as a child?
Thoughts on how I can handle this would be GREATLY appreciated.
Scott
It is my understanding, in a relational DB, that one of the main rules for normalization is to eliminate repetitive information. Another advantage of a relational DB is to avoid maintaining multiple tables with the same data through the use of child tables and relationships.
Here is my problem and question:
I am creating an order / billing application for a small manufacturing business.
I need to have the ability for some of my customers to
have the possibility of multiple ship to addresses.
I first set my customer table up with this idea
Cust1 ABC Corp Bill_to: Same
Cust2 XYZ Corp store #1 Bill_to: XYZ Corp
Cust3 XYZ Corp store #2 Bill_to: XYZ Corp
Cust4 XYZ Corp store #3 Bill_to: XYZ Corp
and so on.
Then I spotted the repeating info an thought of a one-to-many table.
For instance XYZ is the main customer and the billing would all go to:
XYZ Corp
123 Main
This City USA
But I can ship to:
XYZ Corp Store in Main
XYZ Corp Store in California,
XYZ Corp Store in Colorado........... and so on.
This eliminates the problem of repeating BUT doesn't this also introduce the need to maintain to sets of data when I have customers that the ship_to and bill_to are the same?
So now my question: Can I (Would I want to?)link a partent table back on itself as a child?
Thoughts on how I can handle this would be GREATLY appreciated.
Scott
Comment