Answer the question
In order to leave comments, you need to log in
Is it possible to create a foreign key on different tables?
Let's say there is a table all_products that has a unique composite index on the src and src_id fields.
create table all_products(
id int AUTO_INCREMENT,
src int,
src_id int,
PRIMARY KEY(id),
UNIQUE KEY `src_connect` (`src`, `src_id`))
Answer the question
In order to leave comments, you need to log in
no.
such constraints can only be implemented by triggers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question