Path: news.easynews.com!easynews!cyclone2.usenetserver.com!usenetserver.com!news.maxwell.syr.edu!news.shore.net!feedme.ziplink.net!petpeeve.ziplink.net!not-for-mail
From: "David Cressey" <david@dcressey.com>
Newsgroups: comp.databases.theory
References: <v16q7.169$7m1.136122@newsfeed.slurp.net>
Subject: Re: foreign vs primary key
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-Mimeole: Produced By Microsoft MimeOLE V5.00.3018.1300
Message-ID: <qqkq7.39$h4.804@petpeeve.ziplink.net>
Date: Thu, 20 Sep 2001 11:29:26 GMT
NNTP-Posting-Host: 206.15.152.49
X-Trace: petpeeve.ziplink.net 1000985366 206.15.152.49 (Thu, 20 Sep 2001 07:29:26 EDT)
NNTP-Posting-Date: Thu, 20 Sep 2001 07:29:26 EDT
Xref: easynews comp.databases.theory:18418
X-Received-Date: Thu, 20 Sep 2001 04:29:17 MST (news.easynews.com)

Mikeg,

> I have read a number of texts regarding the terms foreign and primary keys
> but I just can't get a feel for their uses.

The foreign keys and primary keys work together.

A primary key identifies a row, based on (part of) its content.

A foreign key references a row which has the matching primary key.

The use of a foreign key establishes a linkage between the row where the
foreign key appears, and the row with the matching primary key.

Establishing linkages without embedding pointers in the data is what makes
the relational system so flexible.



--
Regards,
    David Cressey
    www.dcressey.com


