Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary Key Question

Re: Primary Key Question

From: frank <fbortel_at_home.nl>
Date: Mon, 02 Oct 2000 19:51:41 GMT
Message-ID: <39D8E568.7AB4980B@home.nl>

What would you consider *reasonable*? Maybe the other guy found one field for a natural PK *unreasonable*.

Greg Teets wrote:

> I don't use sequence numbers unless there is no other REASONABLE
> choice. A sequence number is absolutely meaningless (unless you want
> to know the sequence, of course). I think that most well-designed
> tables will have a natural primary key.

Whoeeee. "think" "most" and "well-designed" - seen any legacy applications lately?

> I would prefer to put a
> little effort into determing the primary key and I would feel like I
> have a better understanding of the data in the table.

Not when you put it in a column, named TBC554301... Besides - having to type where a.col1=b.col1 and a.col2=b.col2
and a.col3=b.col3 can get boring. Thus error prone. A perfect reason to chose technical primary keys. Besides they do not ruin your design when someone finds out they left out a field, which also actually needs to be in the PK.
Murphy was an optimist!

>
> Do the other four tables really need sequence numbers as their primary
> keys?
>
> I once worked with a guy who insisted on using sequence numbers even
> when there was a natural key staring him in the face. In the long
> run, it really didn't hurt anything but gave my boss and I something
> to chuckle about.
>
> On Thu, 17 Aug 2000 08:06:39 -0700, Tim Ringwood
> <tringwood_at_e2gotech.com> wrote:
>
> > I was told early on in the world of DBA stuff that a primary key should
> >normally
> >be a sequence number I generate. At times I have use two keys from other
> >tables
> >when the table in question is a join table. The person I am now working
> >with
> >doesn't think you need a sequence number if the table in question is an
> >"end node".
> >(I don't know the correct term, but a table in which isn't refrenced by
> >any other
> >table). Instead the primary key is made up off user inputed data in
> >combination
> >of sequence numbers from other tables (at times having 4 fields making
> >up the
> >primary key). How do people feel about this? Hot debate here!
> >
> >thanks for any feedback!
> >
> >tim
> >tringwood_at_yahoo.com
> >
Received on Mon Oct 02 2000 - 14:51:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US