Understanding Table Relationships in Delivra

Understanding Table Relationships in Delivra

Custom tables in Delivra support different types of relationships based on data needs. Choosing the right table relationship is crucial for ensuring efficient data retrieval and management.

Table Relationships

  1. One-to-One Relationship
    In a one-to-one relationship, one record in Table A is linked to only one record in Table B. This structure is useful when there is a unique identifier for each record. For example, at a university, each student’s email account is linked to one and only one unique student ID.

  2. One-to-Many (Many-to-One) Relationship
    A one-to-many relationship means that a single record in Table A can be linked to multiple records in Table B. This is commonly used in scenarios such as a veterinary clinic, where a single client account can be associated with multiple pet records. Conversely, a many-to-one relationship occurs when multiple records in Table A are linked to a single record in Table B.

  3. Many-to-Many Relationship
    In a many-to-many relationship, multiple records in Table A are associated with multiple records in Table B. An example of this is a retail business where customers place multiple orders, and each order may contain multiple products.

Choosing the Right Key

  • Email addresses should not be used as keys in one-to-many or many-to-many relationships. Instead, a unique identifier such as an account number, order ID, or property ID should be used to ensure accuracy in data mapping.

  • Unique identifiers improve data integrity. Using a dedicated key field ensures that relationships between tables remain stable, even if an email address changes or multiple users share a contact record.

  • Use multiple fields to create a composite key. Select multiple fields as your primary key when creating the table. The combination of all selected fields will be used as your primary key for determining unique records.