liveBook · Manning

Join table

As explained in Building Web APIs with ASP.NET Core

A junction table is a database table that associates rows from two other tables to represent a many-to-many relationship.

A join table is a database table that connects rows from two other tables, representing a many-to-many relationship. Instead of storing every relationship inside either related table, the relationship gets its own table. section 4.1.1

In the board-game schema, the BoardGames table connects to Domains and Mechanics through the BoardGames_Domains and BoardGames_Mechanics join tables. These tables support relationships such as a game having multiple domains or mechanics. section 4.2.4 section 4.1.1

Join tables affect the design and retrieval of relational data in several ways:

  • Require additional tables when the model contains more many-to-many relationships. section 4.1.1
  • Increase the number of JOINs needed to retrieve related information. section 4.1.1
  • Contrast with a document-oriented design, where related mechanics and domains can be embedded in a boardGames collection. section 4.1.1
Figure 4.1 MyBGList database schema diagram for a table-oriented SQL database
04-01

Use the relational schema diagram to trace how BoardGames connects to Domains and Mechanics through separate join tables. section 4.1.1

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines the schema role and retrieval cost, but does not provide join-table SQL or CRUD implementation.
Examples
Uses BoardGames_Domains and BoardGames_Mechanics in a board-game database schema.
What you can do after
Evaluate relational and document-oriented schema choices involving many-to-many data.
How it connects
Connects relational tables, many-to-many relationships, JOINs, and embedded collections.

Also explained in

Compare how 5 books explain join table →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.