473,507 Members | 4,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MYSQL - Navicat - Foreign Keys

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

Jul 23 '05 #1
4 8027
"Simon Bond" <si********@justbackpack.com> wrote in
news:b8****************@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)
Jul 23 '05 #2
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" <he***@letsgo.com> wrote in message
news:Xn************************@216.196.97.131...
"Simon Bond" <si********@justbackpack.com> wrote in
news:b8****************@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)

Jul 23 '05 #3
>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
Jul 23 '05 #4
Yeah good point, thats prolly why.

"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11*************@corp.supernews.com...
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

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3544
by: jacob nikom | last post by:
I would like to create data model for a group of stores. All stores in this group are very similar to each other, so it is natural to allocate one MySQL database per store. Each database is going...
0
3925
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
1830
by: Jeff Silverman | last post by:
I am working on my first database and I think I want to build a table with a foreign key in it. The O'Reilly book on MySQL says that MySQL does not support foreign keys, but it still talks about...
0
1462
by: Chris | last post by:
Hi, I am currently designing a simple service orders database. I have played around with MySQL a bit but this is the first time I'm using it in anger, I have a few design queries to make sure I am...
7
4174
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did...
4
1848
by: Ted | last post by:
Understand, I have developed a number of applications using RDBMS, including MySQL, PostgreSQL and MS Access, but this is my first experience with MS SQL. I'd bet my bottom dollar that MS SQL...
0
1451
by: Harshpandya | last post by:
Hi I am new at ASP and MYSQL. I am Using Navicat to access MYSQL database. My Problem is when i create the foreign key -it gives me this error. 1452-cannot add or update child row: a foreign...
4
9815
by: Harshpandya | last post by:
Hi I am new at ASP and MYSQL. I am Using Navicat to access MYSQL database. My Problem is when i create the foreign key in "Navicat" -it gives me this error. 1452-cannot add or update child...
6
38453
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.