用m:n关系设计一个表的最佳方式 [英] Best way to design a table with m:n relation

查看:666
本文介绍了用m:n关系设计一个表的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为两个实体之间的m:n关系设计一个表的最佳方式是什么?

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

推荐答案

三个表。一个定义第一个实体,一个定义第二个实体,第三个表示它们之间的关系。

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


  • 表1(第一个实体):T1Id ,T1Name

  • 表2(第二个实体):T2Id,T2Name

  • 表3(关系):T1Id,T2Id

这篇关于用m:n关系设计一个表的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆