# Match and Map - Relationships

The Relationships tab enables you to specify the relationships between tables. Table relationships control how a child record is related to a parent record.

The Primary Key in a table identifies each record in the table uniquely. It is often an integer; record 1 has the number 1, etc. However, there is a wide variety of ways that the primary key can be generated.

A Foreign Key is used in a child table to specify which row in the parent table the child belongs to.

For more information about table relationships see Table Relationships.

On the Relationships tab, the Primary Key field must always be supplied.

If the table you are working with is a child table, the Foreign Key value must also be supplied.

Inaport will normally fill in the Primary Key and Foreign Key entries for the Relationships tab; if you are using a table that it does not know about, you must fill them in. Normally the expression with simply be the name of a field. If you have a Primary Key that is composed of more than one field, you can enter an expression that combines the fields.

The Child Key field is used on a Parent Table when the value that a child is using as its Foreign Key is NOT the same as the parent Primary Key.

This can happen, for example, if the normal parent - child relationship has been inverted. Suppose we have specified the Person table as the parent and the Company table as the child. In this case, the Primary Key for the Person table is NOT what the Company table is expecting as its foreign key; instead, it is looking for the company id value in the person record.