# Relations & Lookups

### Relation (Link to another record)

The relationship allows you to link records that have a relation between them. This is particularly helpful when you have multiple tables of related items or concepts. For example, if you have a table of products and a table of categories, you can use a related field to link each product to the category to that they belong.<br>

<figure><img src="https://3331282500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxHpJrX6m3zdP0xxcZ3X%2Fuploads%2FjDMmsGA85RdbxF7aFlk7%2Frelation.gif?alt=media&#x26;token=745194a8-1e24-4dac-b88f-3b2fcd2a36c6" alt=""><figcaption></figcaption></figure>

There are two main types of relationships in Kozmik, single and multiple relationships.

#### Single relations (One-to-Many)

This means that one record has a relationship with multiple other records in a different Table.  For example, a single product can have a single category.

#### Multiple relations (Many-to-Many)

This means that records from both tables can link to multiple records from another table. For example, it's possible that a single product can have multiple categories.

<br>

### Lookup

The Lookup allows you to pull record contents of the linked record into a new column through the relation column. For example, let's say you want to see the description of a category on the Product Detail screen. To do this, you must first add a relation column that uses the Category table on the Product table. Then, you can add a Lookup column using this relation for the description field.

<figure><img src="https://3331282500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxHpJrX6m3zdP0xxcZ3X%2Fuploads%2FjCYouCcry86pSzwxaEXg%2Flookup.gif?alt=media&#x26;token=d5ea9f63-9a8a-42ea-b45e-a0c6522d813b" alt=""><figcaption></figcaption></figure>
