Re: Stupid Database Tricks
- From: "David Cressey" <cressey73@xxxxxxxxxxx>
- Date: Wed, 23 May 2007 09:48:20 GMT
"Marshall" <marshall.spight@xxxxxxxxx> wrote in message
news:1179892760.282700.315160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On May 22, 1:48 pm, Bob Badour <bbad...@xxxxxxxxxxxxxxxx> wrote:
Every table will have a numeric id column, and this column will be the
primary key.
I don't know why, exactly, since it's not like it's the worst one
mentioned, but that one DRIVES ME CRAZY!
Drives me crazy, too. I'm not sure why. Maybe it's because it's such
persistent mythology. I may have discovered at least one origin of this bad
design habit.
My latest interest is, of all things, MS Access. And I'm starting out with
Access 97. It turns out that, if you build a database with one of the
database wizards, this is usually what you get.
Also, if you design your own database and create your own tables, there
comes a time, for each table, where MS Access intervenes, and tells you
that you haven't assigned a primary key, and that one is recommended, and
that Access will do it for you, if that's ok.
If you say "yes" (who wouldn't?) what you get is precisely this: an extra
numeric column, auto assigned, and declared as the key of the new table.
Actually, I can live with this, for so called "entity tables". It would
be better for the newbie DBD to discover a natural key, and declare that,
but it's not so bad. For "relationship tables", the primary key ought to
be a compound key made up of two or more foreign keys. But that isn't what
Access does.
Now let me answer the question, "who wouldn't"? Someone who has learned
database design before building their first Access database, that's who.
But Access makes it seductively simple to design and build your own
database, without even a minimal understanding of the consequences of your
design choices.
There are probably other tools, besides Access, that help to propagate this
bad design habit. But, of them all, Access is probably pretty widespread.
.
- Follow-Ups:
- Re: Stupid Database Tricks
- From: -CELKO-
- Re: Stupid Database Tricks
- From: Bob Badour
- Re: Stupid Database Tricks
- From: Roy Hann
- Re: Stupid Database Tricks
- References:
- Little design mistakes that can easily be avoided (1): Concatenated keys and addition of columns
- From: Cimode
- Stupid Database Tricks (was: Little Design Mistakes)
- From: David Cressey
- Re: Stupid Database Tricks
- From: Bob Badour
- Re: Stupid Database Tricks
- From: Marshall
- Little design mistakes that can easily be avoided (1): Concatenated keys and addition of columns
- Prev by Date: Re: Stupid Database Tricks
- Next by Date: Re: Stupid Database Tricks
- Previous by thread: Re: Stupid Database Tricks
- Next by thread: Re: Stupid Database Tricks
- Index(es):
Relevant Pages
|