Relationships between tables allow you to keep related information together.
Let's assume we want to relate the Orders
table to the Products
purchased by the contact.
The data diagram will look like this:
Thanks to this information model, it is possible to create audiences containing all contacts who have purchased the Sneakers 501.
Procedure
First of all, you need to create the tables that will host the necessary information.
- Create the
Products
table with the desired columns. - Activate the user entity linked to the table
- Create the
Orders
table containing another set of information. - Activate user entity that allows users to modify the records of the table.
- Click the Create a many-to-many relationship button to configure this type of relationship.
- In the window that appears, you must configure the following options:
- Table to connect:
indicate which table will be connected to the one you are operating on; - Association table:
the association of the two tables will create a third table where the data from the previous two will be combined.
Select the value Create a table automatically. In this way, the platform will automatically generate the new table; - Name of the new table:
in this field, you can change the table name proposed by default by the platform; - Field associated with the Primary key of the current table:
indicate the field through which the correlation with the other table will occur; - Field that connects with the other table:
indicate the field of the table related to the one you are operating on now.
- Table to connect:
- Once the configuration is complete, you must save the changes.
- Access the contact database where you want to create the field to connect to the table you just created (in this case, the orders field) and set a "many-to-many" relationship, as in the case described previously.