Re: pro- foreign key propaganda?

From: David Cressey <>
Date: Sun, 18 May 2008 10:15:13 GMT
Message-ID: <RkTXj.2139$Zy1.1952_at_trndny05>

"jonniesavell" <> wrote in message
> > I think you are confusing foreign keys with declarative referential
> > integrity. Foreign keys are a must and I'm sure your database uses them.
> > What you are talking about (and I agree) is a constraint.
> OK. I am stupid. I thought that an instance of declarative referential
> integrity in DDL create a foreign key between one or two tables in the
> database.

Not stupid. Just ignorant. The wonderful thing about ignorance is that it can be cured. Read up on the subject, as others have suggested.

The above argument is about definitions.

> What's the difference?

If I say "select * from orders inner join order_detail

     on orders.order_no = order_detail.order_no;

then order_details.order_no must be a "foreign key" regardless of whether it was declared as such in DDL.

If in the above case, order_details.order_no is for some strange reason NOT a foreign_key reference to the corresponding row in orders, then you are the victim of a sadistic and perverse database designer. Or perhaps just a supremely ignorant one. Received on Sun May 18 2008 - 12:15:13 CEST

Original text of this message