Many-to-Many Relationships - Advanced SQL Engine - Teradata Database

Database Design

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
qby1588121512748.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1094
lifecycle
previous
Product Category
Teradata Vantageā„¢

Assume two entities, A and B.

A M:M relationship exists between entity A and entity B when each occurrence of entity A is related 0, 1, or many occurrences of entity B and each occurrence of entity B is related to 0, 1, or many occurrences of entity A.

M:M relationships are commonly seen in real world situations.

M:M relationships are graphed as follows:



Modeling M:M Relationships

M:M relationships are modeled by placing the primary key of entity A and the primary key of entity B as foreign keys comprising the entire primary key of a separate entity referred to as an associative table. This is another example of the subjectivity of E-R theory, because a relationship is expressed as a physical table in the database.

Guideline for Drawing M:M Tables for Users

Draw entities that represent M:M relationships in a way that data is presented in a form most familiar to users.

Example

The following set of entities models the M:M relationship between A and B: