One way to avoid the association table is to have each of the main tables contain something like a set of records with cross-references in another table - if your DBMS even supports this design. This is infinitely less desirable for many reasons, not least because it is extremely difficult to either request or update the correct list automatically.
Circuit diagram:
create table t1 (id integer, xref_t2 set(integer), ...other columns...); create table t2 (id integer, xref_t1 set(integer), ...other columns...);
Note: there is no easy way to declare a referential integrity constraint to ensure that the values in 'xref_t2' are indeed still valid (or write a trigger to enforce the constraint).
Alternative mechanisms, such as a column with a non-zero value for regular cross-references (one in each table) and a column with a zero value for unusual multiple cross-references (again, one in each table), are still hushed up even more unusual situation when it not a 1: 2 ratio, but a 1: 3 or 1: 4 ratio.
The best way to do this is with an explicit association table.
Jonathan leffler
source share