> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Entity Relation Table

> Learn how to create an entity relation table to connect anonymous users to authenticated users.

**Create an Entity Relation Table**

Learn how to create an entity relation table to connect anonymous users to authenticated users.

[Entity relation tables](/docs/capabilities/metrics/entity-relation-tables.md) connect anonymous users to authenticated users for experimentation.

## Create the Entity Relation Table

**1. Open the entity that should own the relation**

Open the entity that you randomize on (for example, Visitor).

**2. Go to the Entity relation tables section**

In the **Entity relation tables** section, click **Create**.

**3. Input a SQL query**

Input a SQL query that outputs two columns that specifies the mapping between the entities.

**4. Select the columns and target entity**

Select the columns and the target entity (for example, User).

**5. Click Create**

> [!NOTE]
>
> Confidence doesn't clean the data coming from this table, so it's important that it's of high quality
> to ensure trustable experiment results. Any required data cleaning can either be done before the data ends up in the
> relation table, or inline in the table definition since it can be any SQL query.
>
> Below is a short description of possible error cases and how those would affect the results, using the **Visitor** to **User** case as an example:
>
> * No mapping exists for a visitor ID: For metrics with padding enabled, the user is included in the calculation of the metrics for the experiment, but get 0 as the metric value. Otherwise, the user is excluded.
> * Multiple visitor ID's map to the same user: The user would be included once, with first exposure set to the earliest assignment for the visitor ID.
> * One visitor ID maps to multiple users: All users mapped to the visitor ID would be considered exposed to the experiment.

## Create the Experiment

With the entity relation table in place, you can now create the experiment.

**1. Create an experiment**

Create an experiment and choose the entity that owns the relation as the entity to randomize on.

**2. Select metrics from both entities**

When selecting metrics you should now see metrics from both entities in the metric picker that you can then configure as in any other experiment.

## Related Resources

> **[Entity Relation Tables Reference](/docs/capabilities/metrics/entity-relation-tables.md)**
>
> Deep dive into entity relation configuration

> **[Entities Reference](/docs/capabilities/metrics/entities.md)**
>
> Learn about entity types and configuration

> **[Unauthenticated Users](/docs/capabilities/experiments/unauthenticated-users.md)**
>
> Handle anonymous user experiments

> **[Launch an A/B Test](/docs/guides/run-an-ab-test.md)**
>
> Run experiments with related entities
