Are multiple foreign keys in a single field possible?

前端 未结 3 892
攒了一身酷
攒了一身酷 2021-01-15 16:47

I want to know if there is a way to have multiple values in a single field in a MySQL database where each value is a foreign key referencing one other table.

I am de

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 17:05

    If I understand you correctly, the relation product : product_certification is 1:M you can create a foreign key from product_certification to products via product_id, instead of having product_certification_id in the products table (which is invalid, since the product can have more than 1 certification)

提交回复
热议问题