Visual Basic Database Tutorial - Part 5
Let's face it. There are three types of people in this life; the good, the bad and the ugly.
You and I fall into the first bracket; the stunningly good looking and wonderfully intelligent group. The Editor falls into the second band. And the average database design falls into the last, rather disgusting category.
This week, I'd like to give your database design a makeover and move it straight into the upper echelons of the "Good".
So lets start with a case study. Sit back and imagine we're running a pet hospital. You need to record all the information about me. And my pet iguanas. And my pet cow.
Based on the information I've given you already, you'd probably store my name and address all on one row. And on that same line, you'd add details of my pet. Your basic table might look like this:
ID | Name | Address | Pet | Breed |
121 | Karl Moore | The Infirmary | Wiggles | Iguana |
But what about my other pet iguana, Green Thing?
Hmm, I guess you could change your table to look like this:
ID | Name | Address | Pet | Breed | Pet | Breed |
121 | Karl Moore | The Infirmary | Wiggles | Iguana | Green Thing | Iguana |
That's brilliant. Well, in a kind of non-brilliant way.
You see, you've forgotten my third iguana, Strangely Brown. Oh dear.
So how do you get around this? Sure, you could add a third column. But then you've forgotten about my pet cow, Daisy. Doh!
Page 2 of 6
This article was originally published on November 20, 2002