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

Home -> Community -> Usenet -> comp.databases.theory -> Re: foreign vs primary key

Re: foreign vs primary key

From: Dan Star <danstar_at_engman-taylor.com>
Date: Wed, 19 Sep 2001 16:12:17 -0500
Message-ID: <3ba90b40$0$12824$272ea4a1@news.execpc.com>


mikeg wrote:
>
> 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.
>
> any help appreciated,
>
> mike

Think of Parent-Child. The foreign key is a key in a table that is the primary key in another table.

E.G.

  Authors Table

     Author_ID, int, primary key
     First_name, char
     Last_name, char
     DOB, date

  Books Table

     ISBN, char, primary key
     Author_ID, int, foreign key (Authors Table)
     Title, char
     Date_published, date
     Category, char

Dan Received on Wed Sep 19 2001 - 16:12:17 CDT

Original text of this message

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