2

I have one table called "sites" and another table with bibliographical references called "biblio".

Each records in "sites" could be related to multiple records from "biblio"

Each records in "biblio" could be related to multiple records from "sites"

How do you I create the right relations so that my "biblio" table does not contain the same bibliographical reference multiple times?

1

1 Answer 1

3

You need an intermediate table with two columns, site_ID and bib_ID, say. There's a row for each related pair of items, with the ID of the site and the ID of the bibliography.

Or maybe three columns, so each related pair has its own ID.

This is usually called an "n to m" relationship rather than "n to n" since "m" and "n" can be different. The intermediate table is called a "mapping table" here but maybe has different names:

https://www.javaer101.com/en/article/118460902.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.