一对多和多对一关系的区别 [英] Difference between one-to-many and many-to-one relationship

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

问题描述

一对多和多对一关系的真正区别是什么?它只是颠倒了,怎么样?

除此之外,我找不到关于此主题的任何好且易于理解"的教程:SQL 初学者:第 3 部分 - 数据库关系

解决方案

是的,反之亦然.这取决于实体存在于关系的哪一侧.

例如,如果一个部门可以雇佣多个员工,那么部门与员工是一对多的关系(1 个部门雇用多个员工),而员工与部门的关系是多对一的(多个员工在一个部门工作).

有关关系类型的更多信息:

数据库关系- IBM DB2 文档

What is the real difference between one-to-many and many-to-one relationship? It is only reversed, kind of?

I can't find any 'good-and-easy-to-understand' tutorial about this topic other than this one: SQL for Beginners: Part 3 - Database Relationships

解决方案

Yes, it a vice versa. It depends on which side of the relationship the entity is present on.

For example, if one department can employ for several employees then, department to employee is a one to many relationship (1 department employs many employees), while employee to department relationship is many to one (many employees work in one department).

More info on the relationship types:

Database Relationships - IBM DB2 documentation

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

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