Hi all,
I wonder what does "on delete cascade" meaning.
I create two tables for test as below:
CREATE TABLE paper (
paper_id char(12) not null,
abbr_id char(10) not null,
unique (paper_id,abbr_id),
primary key (paper_id),
foreign key (abbr_id) references abbreviation
on delete cascade
on update cascade);
CREATE TABLE abbreviation (
abbr_id char(10) not null,
unique (abbr_id),
primary key (abbr_id));
After that I insert some information on these 2 tables then I test it by
delete one tuple from abbreviation table but there was no effect on paper
table. So what does "on delete cascade" mean? or I do something wrong? At
first I thought when I delete the information from one table, the
information on another table will be delete automatically? Am I wrong ?
please help me, I'm MySQL newbie.
Thank you very much.
-Wachira-