How do you deal with m..n relationships in a relational database?

前端 未结 10 1074
醉梦人生
醉梦人生 2020-12-14 18:48

Let\'s look at an example - books. A book can have 1..n authors. An author can have 1..m books. What is a good way to represent all of the authors of a book?

I came

10条回答
  •  失恋的感觉
    2020-12-14 19:38

    This sounds like a many-to-many relationship, not a 1-to-many. I think you'll want to use a table between those two that allows you to define 1-to-many on either side of that. Check this out...

    http://www.tekstenuitleg.net/en/articles/database_design_tutorial/8

提交回复
热议问题