Home > Archive > MySQL Server Forum > June 2005 > MYSQL - Navicat - Foreign Keys









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MYSQL - Navicat - Foreign Keys
Simon Bond

2005-06-17, 3:23 am

Hi there, I should point out I am very new to MySql, im trying to learn what
I can.
Basically im using Navicat to work with my databases.

When making a foreign key, i am asked to enter the following details....
Foreign Key Name, Field Name, Reference Table, Foreign Field Names, On
Delete, On Update.

Now.. i don't understand why I have to specify a 'Foreign Key Name', as I
thought this would be the equivalant to the 'Field Name' (which is a field
containing my parent_id).
and obviously Foreign Field Name would be my ID from my other table that im
linking.

Soo why Foreign Key Name?

I apologise for my ignorance, but I have searched high and low for the
answer, and can't seem to get a grip around it.

Thanks to all in advance
-sincerly
Simon



Good Man

2005-06-17, 3:23 am

"Simon Bond" <simon.bond@justbackpack.com> wrote in
news:b8rse.19593$F7.650@news-server.bigpond.net.au:

> Hi there, I should point out I am very new to MySql, im trying to
> learn what I can.
> Basically im using Navicat to work with my databases.
>
> When making a foreign key, i am asked to enter the following
> details.... Foreign Key Name, Field Name, Reference Table, Foreign
> Field Names, On Delete, On Update.
>
> Now.. i don't understand why I have to specify a 'Foreign Key Name',
> as I thought this would be the equivalant to the 'Field Name' (which
> is a field containing my parent_id).
> and obviously Foreign Field Name would be my ID from my other table
> that im linking.
>
> Soo why Foreign Key Name?
>
> I apologise for my ignorance, but I have searched high and low for the
> answer, and can't seem to get a grip around it.


are you sure it isnt an open-ended question, asking you to name the
foreign-key you are making? (much like naming an index)
Simon Bond

2005-06-17, 3:23 am

Hmm I guess so, but then why do I have to Name an Index and name a Foreign
key?

How/Why is naming required. I thought defining the relationship between
Table1's ID and Table2's PARENT ID would be enough, but we have to give this
relationship its own name?

im confused..
-simon



"Good Man" <heyho@letsgo.com> wrote in message
news:Xns9677EC74ED84
2sonicyouth@216.196.97.131...
> "Simon Bond" <simon.bond@justbackpack.com> wrote in
> news:b8rse.19593$F7.650@news-server.bigpond.net.au:
>
>
> are you sure it isnt an open-ended question, asking you to name the
> foreign-key you are making? (much like naming an index)



Gordon Burditt

2005-06-17, 3:23 am

>Hmm I guess so, but then why do I have to Name an Index and name a Foreign
>key?
>
>How/Why is naming required. I thought defining the relationship between
>Table1's ID and Table2's PARENT ID would be enough, but we have to give this
>relationship its own name?


So you can delete it or change it later? And perhaps so error
messages can refer to it when it's violated?

Gordon L. Burditt
Simon Bond

2005-06-18, 3:23 am

Yeah good point, thats prolly why.

"Gordon Burditt" <gordonb.apehd@burditt.org> wrote in message
news:11b4qfif5vned3c
@corp.supernews.com...
>
> So you can delete it or change it later? And perhaps so error
> messages can refer to it when it's violated?
>
> Gordon L. Burditt



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com