B
Brendan Reynolds
This question has come up once or twice in the newsgroups recently. I've
read those posts without coming down strongly on either side, but now I'm
faced with a situation where I have to make a decision.
I'm designing a new database that will store information, including
addresses, about school students and their parents. On average, there will
be at least three people at each address. Users should not have to enter or
edit the same address multiple times, but on the other hand if one person's
address changes the addresses of the other people at that address should not
change without the user confirming that this is what should happen.
When one person's address is edited, I'll need to ask the user something
like: 'Do you want to apply this change to all persons at the old address?"
If I store the addresses in their own table, then when the user answers
"Yes" I'll have no extra work to do, but when the user answers "No" I'll
need to create a new address instead of updating the existing address, and
update the foreign key of the addressee record with the PK of the new
address record. On the other hand, if I store the addresses in fields within
the student and parent tables, then when the user answers "No" I'll have no
extra work to do, but when the user answers "Yes" I'll need to update all
records where the address fields match the old values, replacing them with
the new values.
The pros and cons seem about evenly balanced to me. I can't see that either
approach is significantly better than the other. Does anyone disagree?
Anyone think that one approach represents better practice than the other?
read those posts without coming down strongly on either side, but now I'm
faced with a situation where I have to make a decision.
I'm designing a new database that will store information, including
addresses, about school students and their parents. On average, there will
be at least three people at each address. Users should not have to enter or
edit the same address multiple times, but on the other hand if one person's
address changes the addresses of the other people at that address should not
change without the user confirming that this is what should happen.
When one person's address is edited, I'll need to ask the user something
like: 'Do you want to apply this change to all persons at the old address?"
If I store the addresses in their own table, then when the user answers
"Yes" I'll have no extra work to do, but when the user answers "No" I'll
need to create a new address instead of updating the existing address, and
update the foreign key of the addressee record with the PK of the new
address record. On the other hand, if I store the addresses in fields within
the student and parent tables, then when the user answers "No" I'll have no
extra work to do, but when the user answers "Yes" I'll need to update all
records where the address fields match the old values, replacing them with
the new values.
The pros and cons seem about evenly balanced to me. I can't see that either
approach is significantly better than the other. Does anyone disagree?
Anyone think that one approach represents better practice than the other?