I would of course be remiss in my duties as a Perl Monk if I didn't mention that you can write a perl script to create a new, normalized database from this one. No effort beyond writing the script required. You can use some of the code above that accesses the data you have now to be the bulk of the script, and just add some SQL statements.