【发布时间】:2021-09-22 17:40:40
【问题描述】:
一般来说,使实体中的所有属性都成为可能的 concat PK,还是一种不好的做法?一个产品可能有很多标签,我如何为每个产品存储这些标签?是否可以有一个具有 2 个属性的表“标签”:productid 和标签,并将它们都设为主键?
实体:
产品 > productid(PK)、名称、…………
TAGS > productid(FK), tags (concat PK)
谢谢。
【问题讨论】:
标签: sql database composite-primary-key