associative table vs data table

70 Views Asked by At

I've three entities (entity_1, entity_2 and entity_3) and each of them can have multiple videos but one video relates to only one entity (one-to-many). Now I want to know which is the best practice to create a db schema for this.

The solution with data tables The solution with associative tables

The solution with associative tables has the advandtage to only maintain the video table if something changes in the video fields. The disadvantage is to add an additional JOIN for data queries. It also implements an many-to-many relation which is only used as a one-to-many.

What is recommend (best practise) in this case?

1

There are 1 best solutions below

0
On

as you said the relation type is one to many so the best (and most efficient) solution is the solution with "data tables", the second solution you provided is only for many to many relation.

What you described here let me think that even if one video can be linked to several tables, it can not be linked several times to the same table.