"Zachary Agatstein" <[EMAIL PROTECTED]> wrote:
> A very simple question:
> 
> If I have a table A with PRIMARY KEY K,
> and table B which has a column C defined as a FOREIGN KEY F referencing 
> table A.K,
> 
> then, I would expect, C can only take a value from those already existing in 
> table A column K.
> 
> So, let's assume, for simplicity's sake, table A has only 1 column K which 
> is integer, and row are: 1, 3, 6, 7.
> 
> Would it be logical to assume that the column C of the table B cannot have a 
> value of 2, because no such value exists in A.K?

Yes.

> For some reason, in my database no such rule seems to be enforced.
> 
> Do you know why?
> 

Check that type of your tables is InnoDB.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to