No such thing as a small change | |
PerlMonks |
Re: database strategyby Zaxo (Archbishop) |
on Aug 03, 2002 at 01:33 UTC ( [id://187265]=note: print w/replies, xml ) | Need Help?? |
For database design in general, see google database normalization, that lists plenty of tutorial sites. You said on cb that the table you're talking about was constructed without a primary key (a column of unique non-null values) The id column should be it. Realize that this design error may not have a complete solution, and in fact you should hope that the rest of the tables are badly normalized. That will help you because replicated data may give enough clues to reassociate the data to the correct person. Your strategy for doing that looks reasonable, but I would extract the known good data first, making new tables of everything that has a sane id and of all the other tables' records that are associated to uncorrupted accounts. After deleting the good records from the old tables, then start trying to match the corrupt accounts with the leftovers in the other tables. Ultimately, you may need to contact some people directly and get them to identify transactions. That will be embarassing (one hopes to the designers of that mess). Your new tables should each have a primary key, and that key should be the only thing used to refer to a record in another table. Consider autoincrement fields for primary keys. Make sure all the other tables have good primary keys. Do not use timestamps for that. After Compline,
In Section
Seekers of Perl Wisdom
|
|