many-to-many relationship

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When confronted with a many-to-many relationship between tables what will
Access produce if the two tables are joined?
 
Access won't do anything: you have to.

To resolve a many-to-many relationship between two tables, you need to
introduce a third "intersection entity" that contains at least foreign keys
pointing to the primary keys of the two other tables.

For instance, if you've got a many-to-many between Products and Invoices
(one product can appear on many invoices, and an invoice can contain many
products), the Products table has as its Primary Key a field named ProductId
and the Invoices table has as its Primary Key a field named InvoiceId, you'd
introduce a new table "InvoiceDetails", which would have at least ProductId
and InvoiceId as fields in it.
 
You will get everything from both tables where the fields you are linking on
match.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top