I\'ve set up two tables:
CREATE TABLE A
(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT
);
CREATE TABLE B
(
id INTEGER NOT NULL PRIM
The "problem" is that you have set a foreign key on table B.
foreign key(id2) references A(id)
This means that column id2
in table B references column id
in table A. Both Lord of the Rings
and Catch 22
from Table B
are linked to John
from Table A
. Therefore you cannot delete John
without first deleting these other two entries from Table B
first.
The alternative would be to remove the foreign key.
See this documentation for more details.