Many To Many relationship in Query

  • Thread starter יריב החביב
  • Start date
×

יריב החביב

Hello,

Is there a way to make a query with 'many to Many' relationship

between the tables\querys, that it based on ('outer join' in sql) ?

thanks a lot.

Yariv
 
L

Larry Linson

???? ????? said:
Hello,

Is there a way to make a query with 'many to Many' relationship

between the tables\querys, that it based on ('outer join' in sql) ?

thanks a lot.

The way to handle many-to-many relationships is to have a "junction" or
"intersection" table with foreign key to each of the tables. A query will
include all three tables with appropriate Joins.

For example, in a database relating Students to Classes... in which one
student may be taking multiple classes and each class has multiple students,
you'd have three tables:

Students
Classes
StudentInClass - the "junction" table with FK to Students and to Classes

Larry Linson
Microsoft Access MVP
 
×

יריב החביב

thanks
--
תודה רבה


Larry Linson said:
The way to handle many-to-many relationships is to have a "junction" or
"intersection" table with foreign key to each of the tables. A query will
include all three tables with appropriate Joins.

For example, in a database relating Students to Classes... in which one
student may be taking multiple classes and each class has multiple students,
you'd have three tables:

Students
Classes
StudentInClass - the "junction" table with FK to Students and to Classes

Larry Linson
Microsoft Access MVP
 
Top