On Tuesday 21 January 2003 09:56, Saju Pappachen wrote: > In my MySQL I have 3 tables like this and I have a pblm. in setting the > foreign key.Pls. help
[skip] > create table employee_skill_details(EMP_ID int(10) not null references > employee_details(EMP_ID), SKILL_ID varchar(5) not null references > skill_master(SKILL_ID),primary key(EMP_ID,SKILL_ID)); > > > Now based on this I should not be able to add an element to > employee_skill_details table if the curresponding EMP_ID is not present in > employee_details and SKILL_ID is not present in skill_master, because I > have set references for it.i.e. foreign key. But still I am able to add > data in employee_skill_details directly eventhough those data is not > present in the other two tables. > > What is the problem? FOREIGN KEY is supported only on InnoDB tables: http://www.mysql.com/doc/en/SEC449.html In your case REFERENCES do nothing, so MySQL doesn't check if corresponding rows are existing in the parent table: http://www.mysql.com/doc/en/example-Foreign_keys.html -- 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 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php