link two database tables

A very quick question. Is there a term for a table who's primary function is holding two foreign keys? For example, if I have two tables, user and group, is there an official term for the "membership" table that holds user_id and group_id?

Answers


It's an intersection table which supports many-to-many relationships.


A linking/intersection table, which resolves a many-to-many. For instance, if a car can have more than one driver, and a driver can have more than one car, you would use a linking table to resolve the many-to-many relationship. I drew an example ERD in OmniGraffle as an illustration:


As Stefan Already answers: There are link/insersection tables for such a case. They will map many-to-many relations since there is no other possibilities in databases. You only have to create a table "UserGroup" and two columns for the specific ids which are both primary and foreign keys.


Need Your Help

Custom width for an ActionBar Navigation Dropdown (Android)

android android-layout drop-down-menu android-actionbar

I have a custom drop-down navigation ActionBar spinner and it works pretty well.

Interface for reading variable length files with header and footer

java file io

I could use some hints or tips for a decent interface for reading file of special characteristics.