0
$\begingroup$

I know in some many-to-many relationships, an entity is related to other entities on an individual basis. But is this always the case?

For example, in the Authorship relationship between authors and books. An author can write many books, and a book can have many authors. In each such connection, an author is individually connected to the book he/she authors, and vice versa, a book is individually connected to its authors.

However, in some cases, a group of things relate to another group of things. The relationship seems to be between the groups of entities rather than individual entities.

For example in the picture below, one road is drawn as two segments i1 i2 in one map, and three segments j1, j2, j3 in the other map. In a sense, the two groups of segments form a one-to-one correspondence.

enter image description here

But does this situation constitutes a many-to-many correspondence in relational database theory? 

If yes, this is weird, because unlike the authorship relationship, i1 seems to have nothing to do with j3 individually.

If not a many-to-many relationship, what is this kind of correspondence in relational database theory called? And how do we translate this to physical table design?

$\endgroup$
1
$\begingroup$

As far as I could understand, there are 3 entities here.

  1. Map
  2. Road
  3. Road Segment

And the relationships between them are:

  • Map M:N Road
  • Road 1:N Road Segment
  • Map 1:N Road Segment

A map could have multiple roads and a road could in multiple maps. A road could have multiple segments, in each map it is a part of. And a road segment would be related to one map and one road. enter image description here

And to identify whether two segments are related to same road we can query the Road Segment entity to get which segments are related to same roadId.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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