我想知道在什么情况下我们会创建多对多关系。这样做有什么必要?
最佳答案
快速搜索大有帮助。尽管以下是针对 MS Access 的,但概念对于任何关系数据库都是相同的。
通过:office.microsoft.com - Create a many-to-many relationship :
You have a many-to-many relationship when a single record in one table can relate to many records in another, and a single record in that second table can also relate to many records in the first. For example, say your company has several types of computers and several technicians, with each technician certified to work on some, but not all, of the computers. Each technician can be related to more than one computer, and in turn, each computer can be related to more than one technician.
To track who can work on a given machine, you create a many-to-many relationship by adding the primary keys from both sides of the relationship to a third table, called a junction or link table. In other words, a many-to-many relationship is really just a pair of one-to-many relationships.
关于relational-database - 何时或在数据库中使用多对多关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21338554/