Re: foreign key
Posted by:
Atul Singh
Date: February 21, 2008 05:30AM
First of all you will have to check out which version you are using. Older versions of mysql do not support refrential integrity. You can create a foreign key like this
CREATE TABLE users (id INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE profiles (id INT, users_id INT,
INDEX usr_ind (users_id),
FOREIGN KEY (users_id) REFERENCES users(id)
ON DELETE CASCADE
);
I dont't exactly remember in which version refrential integrity introduced. But i am using version 5.0 which is quite stable as of now and supports refrential integrity
Subject
Written By
Posted
November 11, 2007 10:33AM
Re: foreign key
February 21, 2008 05:30AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.