Aside from continuing through this course, how does one gain wisdom as to when to break normalization? Is it only through the School of Hard Knocks?
My example: In a database for an RPG, I'm cataloging items. All Items have common basic properties, e.g. ID, Name, Description, and Weight. Do I create a bunch of one-to-one tables to hold Weapons (Damage, DamageType, ToHitBonus) and Potions (Effect, Duration), etc.? That's good normalization, but bringing the Items together on a character sheet is somewhat of a nightmare-- multiple queries and so forth.
Is there a repository of common patterns that might speed the learning process? Or am I being too lazy?! ; )
When it comes to table structure, I would personally lean toward keeping all items in the same table. Remember, you could have a whole bunch of fields that aren't necessary for every item. Like Effect and Duration wouldn't be applicable to a list of swords. On the form where you need those fields, just display what you need based on the item type. The fields aren't going to take up any extra space. Well, not much anyways; it's negligible.
Or you could go a little more advanced and have a name-value pair secondary table. Where you got your name (such as Effect or Duration) and then the value (the actual effect text or the duration). This gets a lot more complicated. But from a simple perspective, I wouldn't have any problems keeping all of these items in the same table and just giving each one an item type ID.
To answer your question, yes, a lot of it is school of hard knocks. I could teach you all the theory of normalization in the world, but until you've built a handful of databases and seen it in action, it's not going to click as well as if you just do it yourself. This is the perfect example. A few of the first databases I built were Dungeons & Dragons related (storing characters, storing monsters, all that kind of stuff). I built a character generator in Access (way back in the 90s) and even a database to store dungeon maps (data in an XY grid format with doors and traps and stuff).
Games are a fantastic way of teaching people computer programming and database design.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 2.