You are here: Commands > Relations > Choosing Related Tables

Choosing Related Tables

There are several factors to consider before deciding which table should be the parent and which should be the related or child table:

Consider the many-to-one relationship between the keys of the parent table and the keys of the related table. Analyzer matches each key in the parent table with the first matching key in the related table. This may affect your decision about which table should be the parent and which should be the related table.

Another way of saying this is that the parent table should contain all the records you want to analyze. For example, if you have an Accounts Receivable (Ar) table with 500 invoices (records) and a Customer table with 100 records, choosing the Ar table as the parent table allows you to analyze all 500 invoices. On the other hand, if you choose the Customer table as the parent table, you can only analyze 100 records, that is, one invoice for each customer.

Consider also that the relationship is established in one direction, from the parent to the child. Only a parent table can access fields from a child table. A child table has no information about its parent table.