Re: Newbie question about db normalization theory: redundant keys OK?
- From: "Roy Hann" <specially@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Dec 2007 08:35:35 -0000
"Tony Rogerson" <tonyrogerson@xxxxxxxxxx> wrote in message
news:fjtdb3$h58$1$8302bc10@xxxxxxxxxxxxxxxxxxx
CREATE TABLE Schedule
(teacher VARCHAR(15) NOT NULL,
class CHAR(15) NOT NULL,
room INTEGER NOT NULL,
period INTEGER NOT NULL,
PRIMARY KEY (teacher, class, room, period));
That choice of a primary key is the most obvious one -- use all the
columns. Typical rows would look like this:
('Mr. Celko', 'Database 101', 222, 6)
And half way through term the teacher changed their name to 'Mrs Bunting'
and now everybody is confused!
Great example of why you should use an artificial key, I'll remember your
example for a blog entry I'm writing.
I'll remember this. It is a great example of why no one should bother
reading your blog.
Roy
.
- Follow-Ups:
- Re: Newbie question about db normalization theory: redundant keys OK?
- From: Tony Rogerson
- Re: Newbie question about db normalization theory: redundant keys OK?
- References:
- Newbie question about db normalization theory: redundant keys OK?
- From: raylopez99
- Re: Newbie question about db normalization theory: redundant keys OK?
- From: -CELKO-
- Re: Newbie question about db normalization theory: redundant keys OK?
- From: Tony Rogerson
- Newbie question about db normalization theory: redundant keys OK?
- Prev by Date: Re: Newbie question about db normalization theory: redundant keys OK?
- Next by Date: Help needed on Boyce-Codd Normal Form.
- Previous by thread: Re: Newbie question about db normalization theory: redundant keys OK?
- Next by thread: Re: Newbie question about db normalization theory: redundant keys OK?
- Index(es):
Relevant Pages
|