About table-to-table relationships

In Quick Base, a table-to-table relationship helps you organize the data in your app. If you have data that is common across what you need to track, a relationship lets you enter the data once and make references to it later, rather than entering it over and over.

A relationship is an association, or connection, between two tables. When you relate two tables, you save time because you don't need to enter the same info in separate tables. Projects have multiple tasks, a company could have multiple locations, or several books can be written by the same author. In a relationship, you save time and effort by connecting a single record in one parent table to records in a child table.

Why use a relationship?

For example, when entering a new company, it would be nice to enter all the contacts who work there. Or, when entering a new contact, to also pick the company they're with. You can use a relationship to do this. Instead of creating new fields for company info on the contacts form, you can simply connect info from a Companies table right into the Contacts form. And you can summarize all the info from Contacts to display in Companies, for instance, the number of Contacts.

Almost every Quick Base app has several relationships.

When you relate two tables you:

You can create a relationship between any two tables. Most often these tables reside within the same application, but you can create a relationship with a table in a separate application too.

One-to-many relationships

When you create a relationship, you’re telling Quick Base to connect a single record in one table to many records in the other table. This is called a one-to-many relationship.

In a relationship in Quick Base, the table on the "one" side is the parent table and the table on the "many" side is the child table.

It’s easy to think of real-world examples of one-to-many relationships:

Using the companies and contacts example from above:

If there is a one-to-many relationship between a Companies table and a Contacts table, when your employee enters a new contact, the new contact info can be related to an existing customer.

The company name and related info come directly from the Companies table.

For each additional contact, there’s never a need to re-enter company info. And if the company info changes, it’s automatically updated in all the related contact records.

What makes relationship work

When you create a relationship between two tables, Quick Base performs some additional "magic" behind the scenes that transforms each table in useful ways.

For example, after you relate a Contacts table to a Companies table, you can see a list of contacts for that company and enter new contacts directly from the Company form.

Another bit of magic you can perform with relationships is to summarize information from the child records on the parent record, for example, you can summarize the number of contacts for each customer.

Fields used with relationships

To power this magic, every Quick Base relationship includes a reference field. Quick Base creates this field in the child table. It identifies the related parent record. To keep everything organized, Quick Base uses the parent table's key field to populate the child table's reference field. The key field always contains a unique value.

Because the reference field contains the parent record's key field, it usually displays as a number. For instance, instead of "Project Name" users would see the Project ID#. If this happens in your app, you can designate a reference proxy field and use that field in reports and on forms.

When you create a relationship between two tables, additional fields include:

The power of table-to-table relationships

As you learn more about table-to-table relationships, you’ll start to see the remarkable power of this concept and how it can help you create apps that can facilitate complex work flows and business logic.

Here's some additional ideas to illustrate how related tables provide you with benefits for your apps:

Related Topics:

 

Go back      |       |   

© 1999-2018  QuickBase, Inc.  All rights reserved.  Legal Notices.