In SQLite, if a foreign key refers to multiple tables, how can we create a table and insert values? Trying to insert values I got a "foreign key constraint failed" message:
CREATE TABLE ClientPhone
(
phone VARCHAR(10),
clientID INTEGER,
Primary Key (phone),
Foreign key (clientID) REFERENCES CompanyClient(clientID) on update cascade on delete cascade,
Foreign key (clientID) REFERENCES PersonalClient(clientID) on update cascade on delete cascade
);
INSERT INTO ClientPhone VALUES(0402563698,101234);
INSERT INTO ClientPhone VALUES(0427841235,102356);
INSERT INTO ClientPhone VALUES(0465123002,107845);
INSERT INTO ClientPhone VALUES(0401258741,109632);