David,

Not bang on. A foreign key is a key which is the value of a key from a
'parent' table. In MySQL, if the table and its parent are InnoDB, the db
will prevent you from editing the parent key 'out of sync' as you say.

PB

-----


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi again, all --
>
> I apologize in advance for asking kindergarten-level questions on the
> list, but my head is getting really bruised from this one.  I'm trying to
> understand what makes a relational (not necessarily transactional)
> database and how, in what forms, MySQL is that.
>
> It's my understanding that to truly be relational a column in one table
> (let's say "sales") must get its value from a column in another table
> (let's say "customers") rather than just having the same name.  That is,
> it would be easy for anything to have
>
>   +------------------------+             +------------------------+
>   | SALES                  |             | CUSTOMERS              |
>   +---------+-------+------+             +------+-----------------+
>   | product | price | cust |             | num  | name            |
>   +---------+-------+------+             +------+-----------------+
>   | TXLblue | 14.99 | 1136 |             | 1136 | richard roe     |
>   +---------+-------+------+             +------+-----------------+
>   | CMMblck | 11.50 | 2408 |             | 2408 | jane doe        |
>   +---------+-------+------+             +------+-----------------+
>   | SMMblue | 22.75 | 2408 |             | 8421 | bob smith       |
>   +---------+-------+------+             +------+-----------------+
>
> where SALES.cust gets filled with the same value as CUSTOMERS.num -- but
> should the customer number somehow change we're now out of sync, whereas
> in a truly relational database the fields in the SALES.cust column would
> *be* the fields in the CUSTOMERS.num column rather than simply having the
> same value.
>
> Am I lost, out of my tree, confused, or bang on?  And how (perhaps InnoDB
> tables) does MySQL support this if I'm not any of the first three?
>
>
> TIA & HAND
>
> mysql query,
> :-D
> - --
> David T-G                      * There is too much animal courage in
> (play) [EMAIL PROTECTED] * society and not sufficient moral courage.
> (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
Health"
> http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (FreeBSD)
>
> iD8DBQE97SO3Gb7uCXufRwARAooDAKDI6dhugjyejLAEwC5Sjl6Pjqz/nACcDoj0
> vUcEuhNZHvTYh+KjGz05/9Q=
> =hZrX
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to