Should pivot tables have more columns (many to many relationship)
-
26-02-2021 - |
Решение
There is no restrictions on data stored in the pivot table. The simplest case of two IDs establishes only qualitative relations between fridges and foods: this food is stored in this fridge
. If you add the counter you just turn the qualitative relation into the quantitative one: this many units of this food is stored in this fridge
.
On the opposite side you have to control the counters and remove any row having counter dropped to zero to avoid silly logic yes, we store zero units of this food in this fridge
.
Не связан с dba.stackexchange