In the database world the lines that connect the different entities (tables) together are called relationships; these are the relationships that occur in real life between entities as part of a process. Relationships in the database are very important because can play a significant role in the areas as follows:
- Data quality
- Non repeating groups
- business rules enforcement
- Communication on how the business works (or better said how it has been implemented) to IT staff and business users with some modeling skills.
Every RDBMS out there supports four types of relationships. They are as follows:
- One-to-One relationships.
- One-to-Many relationships.
- Many-to-Many relationships.
- Self referencing relationships (aka recursive relationships)
Relationships can be between 1 or more tables. Here is some nomenclature:
|Number of tables in relationship||Tecnical term||Friendly term|
|2||Binary||Two table relationship|
|3||Ternary||Three table relationship|
|4 or more||N-ary||Four or more tables relationship|