From: Raj on
When we have a many to many relationship between 2 tables, why do we create
a 3rd table between known as association table ? Don't seem to understand.
Please assist.

Thanks

From: Gene Wirchenko on
On Wed, 4 Aug 2010 20:53:41 -0700, "Raj" <raj(a)hotmail.com> wrote:

>When we have a many to many relationship between 2 tables, why do we create
>a 3rd table between known as association table ? Don't seem to understand.
>Please assist.

To establish what links to what.

Were it 1-to-many, each row in the many table can have an FK into
the 1 table. How can you do it with many-to-many? Where would you
put the values? With the association table, every valid combination
has a row in the association table with FKs into the two many tables.

Sincerely,

Gene Wirchenko
From: --CELKO-- on
>> When we have a many to many relationship between 2 tables, why do we create a 3rd table between known as association table? <<

The third table is a relationship and not an "association table"; I
have no idea where you got that term.

How else would you do it? Think about it.

A table models either a set of entities or a relationship or an
auxiliary set of data. I have several examples of how to use UNIQUE
constraints set the degree and membership of a relation. If you don't
know those terms, you need to read a book on basic data modeling.