![]() |
|
more useful options | |
PerlMonks |
Re: MySQL Table Creation using DBIby PhiRatE (Monk) |
on Sep 06, 2002 at 00:44 UTC ( #195547=note: print w/replies, xml ) | Need Help?? |
You need to read about database normalisation.
Essentially, what you have here is not a large complicated data structure containing many fields, but a very simple data structure containing very few, as so:
Or similar. You would then be able to retrieve all the contents of the hash by:
It also allows you to get nice aggregate stats as so: Which would give you a nicely sorted list of all the different owners in all the jobs, and a count of how many jobs they own. Even better, its trivial to code for to load and unload from the hash.. etc. Read a good book on SQL, or if you alreayd know SQL decently, on database normali|sz|ation and what it means for your data structures. Create them well, and the database will end up doing all the work for you.
In Section
Seekers of Perl Wisdom
|
|