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

前端 未结 10 1095
醉梦人生
醉梦人生 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:20

    Add another table called BookAuthors with columns for BookID, AuthorID, and NameUsed. A NULL value for NameUsed would mean to pull it from the Author's table instead. This is called an Intersection table.

提交回复
热议问题