Reputation: 3811
I have created two tables within a MySql database:
create table scope (
name_scope varchar(50) not null primary key,
description varchar(100)
);
create table value_scope (
id_value int not null primary key AUTO_INCREMENT,
name_scope varchar(50) not null,
value varchar(100) not null,
foreign key (name_scope) references scope(name_scope) ON DELETE CASCADE
);
A scope can have multiple values. When I delete a scope; I expect its respective values to be deleted as well, but nothing happens. I try to do it the opposite way, but the scope still exists.
What am I doing wrong?
Upvotes: 0
Views: 272