Thursday, May 25, 2006

Tech: So you thought you knew the most basic database rule?

The most basic rule of databasing is First Normal Form. This rule is very simple and glaringly obvious, isn't it? No repeating groups. But how can you abrogate this rule in today's databases? Well, James Koopmann has detailed a couple of ways people have casually broken first normal form! Beware, it's easier than you think. I think the post is a very salient lesson in mindfulness, even if you think you know it all and do it all.

I have seen the latter method myself: a field was changed from one value to a string of values. From memory, this changed the field type from int to char. If you do this, it should be deliberate, with a clear understanding of the ramifications. Or better, don't use such an expedient at all.


Footnote: of course, I'm talking about normalisation of relational databases. When I was first exposed to the concepts - early 1980s - it was largely theoretical. Relational databases were presented as only one model, alongside hierarchical and, um, network [thanks Wiki] models. Thank god technology has caught up, and sense prevails.

No comments: