h1

Relationships

January 8, 2009

An important component of any relational database is how those relations are associated with each other. These associations, or relationships, link relations together in ways that are meaningful to each other, helping to ensure the integrity of the data so that an action taken in one relation does not negatively impact data in another relation.

A relational database supports three primary types of relationships:

One-to-One: A relationship between two relations in which a tuple in the first relation is related to only one tuple in the second relation, and a tuple in the second relation is related to only one tuple in the first relation.

One-to-Many: A relation between two relations in which a tuple in the first relation is related to one or more tuples in the second relation, but a tuple in the second relation is related to only one tuple in the first relation.

Many-to-Many: A relationship between two relations in which a tuple in the first relation is related to one or more tuples in the second relation, and a tuple in the second relation is related to one or more tuples in the first relation.

Note: A many-to-many relationship is physically implemented by adding a third relation between the first and second relation to create two one-to-many relationships.

Advertisements
%d bloggers like this: