Table Relationship Types
Note:
- The parent table determines the table relationship. For example, when the CONTACT table is the parent table, it has a One to One relationship with the Account table. However, when the ACCOUNT table is the parent table, the relationship is One to Many. In the Example column, parent table names are in italics.
- You cannot work with tables that have a Many to Many relationship directly. You must use a link table, an intermediary table whose purpose is to resolve Many to Many relationships by creating a link between the tables. If you need information from the USERINFO and ACTIVITY tables, use the USER_ACTIVITY table to access these tables. The USER_ACTIVITY table is a link table.
To express the types of relationships between tables, use these terms:
Term | Symbol | Description | Example |
---|---|---|---|
One to One | For a single record in one table there is only one related record in another table. | A contact is related to only one account; therefore, the relationship between the CONTACT and ACCOUNT tables is One to One. | |
Zero to One | For a single record in one table there is none or one related record in another table. A Zero to One relationship can occur after a table has been set up with a One to One relationship to another table that does not have any records. | An activity might not be related to any opportunities. If it is related to an opportunity it is only related to one opportunity; therefore, the relationship between the ACTIVITY and OPPORTUNITY tables is Zero to One. | |
One to Many | For a single record in one table there is one or more related records in another table. | More than one contact can be associated with an account, but at least one account is always associated with a contact; therefore, the relationship between the ACCOUNT and CONTACT tables is One to Many. | |
Zero to Many | For a single record in one table, there may be zero or many records in another table. A Zero to Many relationship can occur after a table has been set up with a One to Many relationship to another table that does not have any records. | A contact may have zero or many activities; therefore, the relationship between the CONTACT and ACTIVITY tables is Zero to Many. | |
Many to Many | There are many records in one table that relate to many records in another table. | A user can have many activities and an activity can have many users; therefore, the relationship between the USERINFO and ACTIVITY tables is Many to Many. |
Related topics