About
This page is about relationship in a relational model.
In a relational model, as a relation (generally a table) can model:
- an entity
- or a relationship
Therefore, a relationship between two relations is not always a relations between two entities.
cardinality define the type of relationships between two relations.
Because most of database only support one-to-many relationships, it is necessary to implement other relationships physically via a third junction table (association table).
Type
Mapping: Information about the number of entities in each entity set which is allowed in a relationship set is indicated by specifying 1, m, % in the diagram
In a data model, two main relationship are used :
- one-to-many (or many-to-one)
- and many-to-many
but you can found other types as :
- optional on one side one-to-one
- …
To describe precisely the type of relationship in a data model, you use the cardinality.
Relationship table
The following tables are the most common tables that holds a relationship:
- Relational Data Modeling - Association Table (Bridge, Cross) (many-to-many)
- Dimensional Data Modeling - Fact Table (one-to-many)
- Dimensional Data Modeling - Hierarchy (one-to-many)
Every table with a foreign key holds a relationship.