You are here: Commands > Relations > Planning Relations Between Tables

Planning Relations Between Tables

Successful data relations require careful planning. Determine which tables contain fields you need to relate and consider the most effective way to relate them.

For example, you may need to analyze data that is found in several different tables. You will need to identify which tables contain the data fields you need and which additional fields could serve as key fields. It is often useful to create a diagram to identify the relationship possibilities.

The Ar table and the Customer table, for example, both contain a Customer Number field that can be used as a key field in forming a relationship between these two tables. Such a relationship provides access to all fields in the Ar table as well as to relevant fields in the Customer table: Name and Credit Limit.

Once you have established a relationship between the two tables, you can access the Customer Name and Credit Limit fields in any commands that you issue from the parent Ar table. If you want, you can also add these fields to the View of the Ar table.

Once the relationship is established, the Sales Rep Number field can be accessed from the Ar table. If you want, you can add this field to the View of the Ar table. You can also use the Sales Rep Number field as a key field to relate the Ar table to the Sales Rep table and add the Sales Rep Name field to the Ar table’s View. Now all the fields of interest are in the Ar parent table’s View and can be analyzed as though they existed in the Ar table.

Note: You can work with fields from related tables whether or not you have added them to the parent table’s View. Once you have established the relationships, all related fields are available for analysis from the parent table and appear in field selection lists for commands and in the Expression Builder.