A
A
Alexey Konovalov2019-06-28 23:12:37
Database design
Alexey Konovalov, 2019-06-28 23:12:37

Is a link table necessary?

I read a lot where that if two tables are connected "one-to-many" (one author has many books), then you need to make a table of books, a table of authors and a link table that will link the IDs of the authors with the IDs of the books.
Please explain what is the benefit. After all, it is much more convenient to make the author_id field in the books table. I can't find any reason why I can't do it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2019-06-28
@Stalker_RED

Books are many to many.
A book can have more than one author.
Let's take another example.

M
Maxim Y, 2019-06-28
@x_shader

A junction table is needed for a many-to-many relationship. One book can have multiple authors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question