How to establish connection between tables in mysql with this difficult situation?

There is table A, which contains data that refers to the “record of one of the other three tables (B, C, D)” How can I establish a relationship between them? The easiest way is to define a "reference_id" column to denote an identifier (record) and a column table that references one of these three tables and connect to the target record with "if conditions", but I think there should be a better way to handle this situation.

image of tables

+4
source share
1 answer

There are three solutions to this problem.

, , .
- , .
- A, (B, C, D). B, b_id c_id d_id null. , .

+1

Source: https://habr.com/ru/post/1648340/


All Articles