I am using MYSQL 4. I understand that it allows for
foreign keys. Could someone show me an example of how
to declare a foriegn key. I tried a combination of
statements but I always got a syntax error. 

 Here is what I am trying for example ...
 
 Create table x (
 ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 whatever int
 
)Type=Innodb;


 Create table y (
 IDTr INT NOT NULL,
 constraint FOREIGN KEY  IDTr REFERENCES x(ID)
)Type=Innodb;

 How would I create a foreign key linking IDTr to
x(ID)?

Cheers.

 Cheers.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.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