---
title: Datawarehouse Connection
slug: nov6-fac-lab/datawarehouse-connection
docTags: 
createdAt: 2024-08-09T14:13:45.126Z
---

### Business Context

**Secur**Financial is a leading financial services firm. Leverages its wealth of customer data across disparate sources to personalize offers and campaigns for a large number of segments. &#x20;

### Use Case

<font color="#480bee">SecurFinancial would like to launch an email campaign to retarget its customers who are prequalified for a loan based on good credit and do not have an active loan in their SecurFinancial portfolio. While they are ingesting online behavioral data in real time, they face challenges in identifying customer prequalification, as they are restricted from ingesting credit information into AEP. To qualify prequalified customers without moving restricted data, they will use Federated Audience Composition to enrich their AEP behavioral audience.</font>

### \[Hands off keyboard!]

This demo will guide you through the process of using Experience Platform Federated Audience Composition to connect to Snowflake and query an audience.

### Prerequisites:

- Adobe Experience Platform account with appropriate permissions.
- Data warehouse account with the necessary database and credentials.

To setup a connection with your database, follow these steps:

![](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/config/media_1ae89282123f64ad2ba55992da2be43421e675f81.png?width=750\&format=png\&optimize=medium)

1. Browse to **FEDERATED DATA** section on the left rail.
2. In the **Federated Databases** link, click on **Add federated database** button.
3. Add a name and select **Snowflake**
4. Fill in the details, click on **Test connection** button, and on **Deploy functions** button.

For this lab, we will connect to a **Snowflake** account. Federated Audience Composition has a growing list of cloud warehouse connections. See link below for an updated list of integrations

[https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/start/access-prerequisites](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/start/access-prerequisites)

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/ETHdo3gcGSNM2aJoXNQ7w_screenshot-2025-02-18-at-52216-pm.png)

![](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/config/media_15e818a593305a763b1a52d6f17574099a1c4b4a9.png?width=750\&format=png\&optimize=medium)

![](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/config/media_114d2d0d4ec2b998a5eee896c0cc634db1722e807.png?width=750\&format=png\&optimize=medium)

![](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/config/media_1552974c2704d6b7ca5675b5e65a9b44154d9cd11.png?width=750\&format=png\&optimize=medium)

# Create a schema

To create schemas in Federated Audience Composition, follow the steps below:

1. In th&#x65;**&#x20;FEDERATED DATA** section, click **Models**.
2. Browse the Schema tab and click on the **Create schema** button.
3. Select your source database in the list, and click on the **Add tables** tab.

Select the following tables

- **FSI\_CRM**
- **FSI\_CRM\_CONSENT\_PRFERENCE**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/XsiiP18icHHiqUdR9F39L_screenshot-2025-02-24-at-112033-am.png)

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/ECj5iRjikK9e4wpV9jDtJ_screenshot-2025-02-24-at-112054-am.png)

After selecting your tables, you can review the columns of each table then find and select your primary key. For this exercise, we will select **EMAIL** as primary key in both tables

![](https://api.archbee.com/api/optimize/2QtaDNQUOaQJJ0ppk7Fjc-qfaWQjxyYWLJ6UH0a-CR7-20250224-162435.png)

![](https://api.archbee.com/api/optimize/2QtaDNQUOaQJJ0ppk7Fjc-2M4GuwaTYjlIgJYNEZ26d-20250224-162455.png)

## Preview data in a schema

To preview the data in the table represented by your schema, browse to the **Data** tab as shown below.

Click on the **Calculate** link to preview the total number of records.



![](https://experienceleague.adobe.com/en/docs/federated-audience-composition/using/config/datamodel/media_16017fc4852ecb3fd1916e9dccf3c2fb203d9fcac.png?width=750\&format=png\&optimize=medium)

# Create a data model

Data models allow you to create a link between tables. The link can be created between tables in the same database such as tables in Snowflake. You can also create a link between tables in different databases such as a link between a table in Snowflake and a table in Amazon Redshift.

To create a data model in Federated Audience Composition, follow the steps below:

1. In FEDERATED DATA section, click **Models** then click **Data Model**. Click the **Create data model** button.
2. Provide a name for your data model.
3. Click on Add schemas and select **FSI\_CRM** and **FSI\_CRM\_CONSENT\_PREFERENCE** schemas.
4. This will now allow you to create a link between these tables, click on **Create links**.&#x20;
5. When creating a link, choose the applicable cardinality
   1. **1-N**: one occurrence of the source table can have several corresponding occurrences of the target table, but one occurrence of the target table can have at most one corresponding occurrence of the source table.
   2. **N-1**: one occurrence of the target table can have several corresponding occurrences of the source table, but one occurrence of the source table can have at most one corresponding occurrence of the target table.
   3. **1-1**: one occurrence of the source table can have at most one corresponding occurrence of the target table.

Below is a preview of the link created for the lab exercises. The link enables a join between the CRM and consent tables, using the primary key of EMAIL to perform a join.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/Z_HrQk3ewp-1dETboNHOF_screenshot-2025-02-24-at-113435-am.png)



