Link
Link fields are powerful tools in data management that allow users to establish relationships between different tables. Through link fields, users can easily insert records from other tables into the current table and quickly view and navigate to linked data tables.
Creating Link Fields
Open the table where you need to add a link field. Select “Add Field,” then choose “Link Field.” From the dropdown menu, select the table you want to link to.
Select the link type: Open the table where you want to add a link field, click “Add Field,” then select “Link Field.” Choose the table you want to link to from the dropdown menu.
One-way vs. Two-way Links: If you want data to update only in the current table, choose a one-way link. If you want both tables to reflect link changes, choose a two-way link. Two-way links create a symmetric link field in the linked table, and the data in both link fields is always mutually mapped.
Define Link Relationship: Configure the current table field and corresponding link field, determining whether to Allow Single Selection or Allow Multiple Selection. Through the combination of configurations for both link fields, we can define the relationship between data, which is explained in detail below.
One-way vs. Two-way Links
Users can choose whether to create two-way links based on their needs.
One-way Links
Definition: A link created in one table does not automatically create a link in the other table. Example: Imagine following a celebrity on social media - you can see their updates, but they might not know who you are.
Two-way Links
Definition: A link created in one table automatically creates a corresponding link in the other table. Example: Like Facebook friend requests - when you add someone as a friend, they also add you as a friend.
Link Relationships
When building relationships in databases, we typically encounter several types of link relationships. These relationships help us better organize data and understand interactions between different tables.
Link Relationships and How to Establish Them
Relationship Type | Description | Example | How to Create in Table A |
---|---|---|---|
One-to-One | One record in Table A links to only one record in Table B. | An author and their unique autobiography. | Single select in Table A + Single select in symmetric Table B field |
One-to-Many | One record in Table A can link to multiple records in Table B. | An author and their multiple books. | Multiple select in Table A + Single select in symmetric Table B field |
Many-to-One | Multiple records in Table A might link to one record in Table B. | Multiple authors with one common publisher. | Single select in Table A + Multiple select in symmetric Table B field |
Many-to-Many | Multiple records in Table A can link to multiple records in Table B. | Multiple authors and multiple literary awards. | Multiple select in Table A + Multiple select in symmetric Table B field |
Relationship Examples Analysis
To better understand these relationship types, let’s use authors and their works as examples:
- One-to-One Relationship: If J.K. Rowling wrote only one autobiography, then there’s a one-to-one relationship between her and this autobiography.
- One-to-Many Relationship: J.K. Rowling wrote multiple books in the “Harry Potter” series. Here, there’s a relationship between one author and multiple books.
- Many-to-One Relationship: If we consider multiple authors like J.K. Rowling, George Orwell, and Jane Austen all working with one publisher “Classic Books,” then the relationship between these authors and the publisher is many-to-one.
- Many-to-Many Relationship: Suppose “International Literary Award” and “Best Author of the Year” are two awards, and both J.K. Rowling and George Orwell have won both awards. In this case, there’s a many-to-many relationship between the two authors and the two awards.
Important Notes
In a one-to-many relationship in Table A, the same record from Table B can only be selected once in Table A. In other words, once a record from Table B is selected as a linked record in Table A, that record will not appear in the selection list in Table A again. This is determined by the nature of the link relationship.
Example: Suppose we have an “Authors” table (Table A) and a “Books” table (Table B). In the “Authors” table, there’s a one-to-many relationship field for selecting books written by each author. Now, when we select “Harry Potter and the Philosopher’s Stone” for one author, this book won’t appear in the selection list for other authors because it’s already linked to one author. This ensures each book can only be linked to one author, following the one-to-many relationship rules.
Further Extensions
After setting up link fields, we can proceed with advanced lookup and rollup operations. These features work together to achieve powerful automatic data lookup and aggregation calculation capabilities. Please see the Lookup and Rollup Field sections for details.