From owner-freebsd-questions Sun Sep 3 14:32:52 2000 Delivered-To: freebsd-questions@freebsd.org Received: from pop.idx.com.au (pop.idx.com.au [203.14.30.10]) by hub.freebsd.org (Postfix) with ESMTP id C897537B424 for ; Sun, 3 Sep 2000 14:32:48 -0700 (PDT) Received: from freebsd.freebsd.org (tntwc01-3-108.idx.com.au [203.166.3.108]) by pop.idx.com.au (8.9.3/8.9.3) with SMTP id IAA10033 for ; Mon, 4 Sep 2000 08:32:44 +1100 From: Danny To: freebsd-questions@freebsd.org Subject: MySQL FOREIGN KEYS Date: Mon, 4 Sep 2000 07:36:09 +1100 X-Mailer: KMail [version 1.0.21] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <00090407430402.00345@freebsd.freebsd.org> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -- 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