sql server中多对多关系和一对多关系之间的区别是什么? [英] what is the diffrences between many to many relation and one to many relation in sql server?

查看:188
本文介绍了sql server中多对多关系和一对多关系之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sql服务器数据库的逻辑设计中有问题.我仍然无法区分哪个关系必须是一对多的,哪个关系必须是多对多的?有人告诉我,如果两个实体表都是独立的,则它们可以具有多对多"关系,否则它们将具有一对多的关系.

但是现在我正在一个收集员工个人信息的项目中,其中一部分有一个称为JobStatus的表,用于该人的当前工作.该表与Person(table)的关系为Many对许多人来说,他们之间当然有一个交汇处.我之所以建立这种关系,是因为一个工作职位的名称分配给多个人且表现不同.
例如:人员A ----->运营商perosn B ------>运营商等等...
另一方面,有些情况是一个人有两个工作职位,我的意思是他既是董事又是老师.例如:
C人------>导演兼老师

所以,请您用这种模棱两可的逻辑方法指导我吗?

I have a problem in logical design of Sql server database . Still i can not distinct which relation has to be One to Many and which one has to be Many to Many? Some one told me if both entity tables are independant , they can have Many to Many relation , else they will have one to many.

But now i am working on a project that collect personal information of the employees , in one part there is a table known as JobStatus which is for the personle''s current job.this table has a relationship with Person(table) that is Many to Many,ofcourse there is a junction table between them . I made this type of relation because one job position''s name is assigned to several persons and with different performance.
For instance : Person A ----->Operator perosn B------>Operator and so on...
And in other side there are some cases that a person has two Job position , i mean he is either a director and a teacher . For instance :
Person C ------>Director & Teacher

So would you please guide me in this ambiguous logical mean?

推荐答案

^ ]
http://www.anchor.com.au/hosting/support/CreatingAQuickMySQLRelationalDatabase [ ^ ]
Basic Handling and Tips of Database Relationships in Entity Framework[^]
http://www.anchor.com.au/hosting/support/CreatingAQuickMySQLRelationalDatabase[^]


这篇关于sql server中多对多关系和一对多关系之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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