Best way to design a table with m:n relation

独自空忆成欢 提交于 2020-01-25 11:54:04

问题


What is the best way to design a table for a m:n relation between two entities??


回答1:


Three tables. One defining the first entity, one defining the second, and a third representing the relationship between them.

  • Table 1 (first entity): T1Id, T1Name
  • Table 2 (second entity): T2Id, T2Name
  • Table 3 (relationship): T1Id, T2Id


来源:https://stackoverflow.com/questions/29400091/best-way-to-design-a-table-with-mn-relation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!