This article defines the different types of table relationships, how to view them, the different ways they are displayed by the User Interface. It is accompanied by a demonstration video about how to avoid and resolve some of the most common mistakes users make when using table relationships in WorkBench and Batch Edit data sets.
Table relationships shape how data behaves throughout Specify, from forms to queries to bulk actions. Many common data issues begin with a misunderstanding of these relationships. This article walks through the core concepts, shows where to find relationship information in the interface, and provides examples and best practices to help you avoid problems and correct them when they occur.
Transcript:
Dependent and Independent Table Relationships Webinar Transcript 2.vtt (23.5 KB)
Understanding table relationships
A table relationship is a connection between two tables in the Specify data model. Relationships can be categorized based on their cardinality and dependence, which determine exactly how records in two tables can interact.
Cardinality
A relationship’s cardinality, also referred to as the relationship type, determines how many records in one table can be linked to a record in another table. Cardinality can be characterized as one-to-one, one-to-many, or many-to-one.
Tip: Cardinality notation
Thinking of cardinality as a simple left-to-right statement can help you understand which table is on the one side, which table is on the many side, and what that tells you about how the data connects.
When viewing a relationship, think of the base table, or the table you have selected in the Schema Config/Database Schema viewer, as being on the left-hand side. Think of the related table as being on the right-hand side. The relationship’s cardinality goes in the middle. This looks like:
(Base Table) Cardinality (Related Table)
In this screenshot from the Schema Config, Collection Object is the base table, and Preparation is the related table. The Schema Config automatically displays the related table on the right-hand side of the relationship.
With both sides of the relationship, the notation would look like:
(Collection Object) One-to-many (Preparation).
Once you know which side each table is on, you can read it naturally as the phrase:
“One Collection Object relates to many Preparations.”
One-to-one
In one-to-one relationships, a record can link to only one record in another table.
Examples of one-to-one relationships include:
(Collection Object) One-to-one (Collection Object Attribute)
“One Collection Object relates to one Collection Object Attribute.”
(Locality) One-to-one (Locality Detail)
“One Locality relates to one Locality Detail.”
One-to-many
One record can link to multiple records in another table.
Examples of One-to-many relationships include:
(Accession) One-to-many (Collection Object)
“One Accession relates to many Collection Objects.”
(Taxon) One-to-many (Determination)
“One Taxon relates to many Determinations.”
Many-to-one
Multiple records can link to only one record in another table.
Examples of Many-to-one relationships include:
(Determination) Many-to-one (Collection Object)
“Many Determinations relate to one Collection Object”
(Loan Preparation) Many-to-one (Loan)
“Many Loan Preparations relate to one Loan”
Dependence
Another attribute of relationships is called dependence. A relationship’s dependence indicates whether a record in one table can exist without being associated with a record from another table.
- Dependent: A record can only be created if it is associated with a record from another table.
- Independent: A record can be created without being associated with a record from another table.
Exploring Table Relationships
There are multiple tools in Specifyh in which you can view a table’s relationships, relationship type, and/or dependence.
-
Database Schema: To view the relationships for each table, you can use the Database Schema tool under User Tools. After clicking on a table, view the Type (cardinality) and Dependent columns under Relationships.
-
Schema Config: After selecting a base table to view in Schema Config, you can find the Relationships section to view a list of table relationships. You can view a relationship’s Type (cardinality) after selecting a relationship.
-
Query Builder: In the query builder, a list of relationships appears below the list of fields in each table. Every relationship is accompanied by an arrow > button, and selecting a relationship shows displays fields in the related table. To view both hidden and unhidden relationships, click Reveal Hidden Form Fields.
Interpreting Table Relationships
Table relationships appear and behave differently in the User Interface based on their cardinality and dependence. These differences are evident in the Query Builder, data entry forms, and WorkBench/Batch Edit.
Query Builder
In the Query Builder, relationships with a to-one relationship can be mapped as (formatted), while relationships with a to-many relationship can be mapped as (aggregated).
Forms
-
Query Combo Box: Query combo boxes represent an independent to-one relationship.

-
Subform: Subforms with both Add (
) and Delete (
) buttons represent a dependent to-many relationship. Dependent relationships can also be rendered as a subform, but only one record can be added.
-
Independent Subview: A subview with a Search (
) button indicates an independent relationship.
-
Related Record Deletion: Dependent records are deleted using the
button on form or button subviews and the
button on grid subviews.
Independent records are deleted using the Delete button with the related recordsbutton on the left side of the form.
Bulk Actions
| WorkBench Abilities | WorkBench Limitations | Batch Edit Abilities | Batch Edit Limitations |
|---|---|---|---|
| Upload new dependent records to existing independent ones. | No uploading to-many independent records. | Batch delete or unlink dependent records. | No deleting independent records. |
| Upload new and match to existing independent records. | Cannot update links to related records. | Unlink independent records. | Cannot delete and unlink dependent records in one dataset. |
Bulk Actions and Related Records Example Scenarios
In this video, Bronwyn explains some of the most common mistakes users make when performing bulk actions involving related tables and demonstrates how to resolve them.
Transcript:
Dependence Webinar Demo Transcript.vtt (9.3 KB)
[!warning]
Always follow the instructions in How to Create a Full Database Backup in Specify to create a backup of your database before using the WorkBench or Batch Edit.
Blank Determinations
Determinations must be uploaded with a yes/no value in the Current field to indicate whether or not a Determination is the most up-to-date. This occasionally causes users to unintentionally upload additional Determinations that contain no other data. See more details in the video and the table below.
| Action | Outcome | Resolution | Best Practice |
|---|---|---|---|
| Upload Determinations with yes/true or no/false in each row of the Current? column(s) regardless of if there’s more data for that Determination record in other columns or not. | A new determination will be created for each row. Since the only input is that Current? is false/no, the determinations will appear blank on the forms. | Delete “Blank” Determinations in Batch Edit. | Only add False/No to cells in the Is Current? column when associated with a non-current determination record. |
Determiner vs. Determiners
The Determination table has two Agent relationships–Determiner (to-one) and Determiners (to-many)–allowing you to customize the number of Agents that can be associated with a Determination. Using them interchangeably can cause confusion if one or the other is included on forms or in queries. If you do not hide the correct relationship in the Schema Config, it can be easy to accidentally map and upload data to the wrong relationship in the WorkBench.
| Action | Outcome | Resolution | Best Practice |
|---|---|---|---|
| Upload to Determiners (to-many), but your forms and records use the to-one Determiner relationship. | The recently uploaded Determination records appear without a determiner on the forms. | Transfer Agent data between tables using Batch Edit. | Ensure that Schema Config is accurate and up to date to avoid accidentally choosing the wrong field or table in the field mapper. |
Accidental Agent Duplicates
Agent records are some of the most commonly duplicated records, as the spelling of names, use of initials, and population of certain fields are often inconsistent between data sets. If the WorkBench or Batch Edit is not given the correct information required to match to an existing Agent, a new record is created, leaving you with multiple records that are meant to represent one person.
| Action | Outcome | Resolution | Best Practice |
|---|---|---|---|
| Include data that conflicts with the existing Agent record(s) in the upload. Conflicting data might be a typo in the Last Name column, a period after the middle initial, or a missing abbreviation. | Prevents matching to the existing Agent; a duplicate Agent record is made where the only difference is the unnoticed conflict. | Merge duplicate Agent with the existing Agent record. | 1. Use as few columns as possible for related record matching to reduce the risk of inadvertent duplication. 2. After validating, always pay attention to cell highlights. 3. If no new records should be created by the upload for a certain related table, add the Must Match preference for that table. |
General Best Practices
- Take a backup of the database before uploading with the WorkBench or making changes in Batch Edit.
- Create a record set of records you want to edit. Query from that record set and then Batch Edit from there to limit dataset with certainty.
- Always pay attention to cell highlights and review results before uploading or committing data.
- Always review imported data immediately after uploading. This way, you are more likely to be able to roll back should anything need fixed!
Webinar slide deck:
Table Rels Webinar Slides.pdf (6.9 MB)







