Date: Mon, 4 Sep 2000 07:36:09 +1100 From: Danny <dannyh@idx.com.au> To: freebsd-questions@freebsd.org Subject: MySQL FOREIGN KEYS Message-ID: <00090407430402.00345@freebsd.freebsd.org>
next in thread | raw e-mail | index | archive | help
-- I am rnning mysql on FreeBSD 3.3 - I type in the following cliche example of a database CREATE TABLE Customer (Customer_ID INT NOT NULL AUTO_INCREMENT, Customer_Name varchar(20), Customer_Address varchar(50), Customer_Email varchar(50), PRIMARY KEY (Customer_ID)) ; CREaTE TABLE Agent (Agent_ID INT NOT NULL AUTO_INCREMENT, Agent_Name varchar(20), Agent_Address varchar(50), Agent_Email varchar(50), PRIMARY KEY (Agent_ID)) ; CREATE TABLE Assign (Assign_ID INT NOT NULL AUTO_INCREMENT, Customer_ID INT, Agent_ID INT, PRIMARY KEY (Assign_ID), FOREIGN KEY (Customer_ID) FROM Customer ON UPDATE CASCADE, FOREIGN KEY (Agent_ID) FROM Agent ON UPDATE CASCADE, ) ; When I connect to the database and I type in DESCRIBE Assign It doesn't show Foreign keys in the database design Question 1) Is mySQL not ANSI SQL compliant? 2) How would I code the SQL in the above example to use Foreign keys ? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00090407430402.00345>