Re: foreign vs primary key
Date: Wed, 19 Sep 2001 15:38:33 -0500
Message-ID: <nd8q7.223$7m1.159782_at_newsfeed.slurp.net>
"Dan Star" <danstar_at_engman-taylor.com> wrote in message
news:3ba90b40$0$12824$272ea4a1_at_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
>
Thanks, I can see that but what is the significance? Why is it necessary to identify the foreign key? How are they used? Aren't primary keys enough? Received on Wed Sep 19 2001 - 22:38:33 CEST