{"componentChunkName":"component---src-templates-markdown-template-jsx","path":"/guides/data-warehouse/composable-audiences/data-models/overview/","result":{"data":{"pageMetadata":{"title":"Data Models Overview","path":"/guides/data-warehouse/composable-audiences/data-models/overview/","sourceCode":null,"metadataParent":{"title":"Data Models","path":"/guides/data-warehouse/composable-audiences/data-models/","sourceCode":null,"hasVersionPicker":null,"metadataChildren":[{"title":"Data Models Overview","path":"/guides/data-warehouse/composable-audiences/data-models/overview/","order":1,"label":null},{"title":"Create a User Data Model","path":"/guides/data-warehouse/composable-audiences/data-models/user-data-models/","order":2,"label":null},{"title":"Create an Event Data Model","path":"/guides/data-warehouse/composable-audiences/data-models/event-data-models/","order":3,"label":null},{"title":"Create a Generic Data Model","path":"/guides/data-warehouse/composable-audiences/data-models/generic-data-models/","order":4,"label":null}],"metadataParent":{"title":"Composable Audiences","path":"/guides/data-warehouse/composable-audiences/","metadataChildren":[{"title":"Warehouse Setup Overview","path":"/guides/data-warehouse/composable-audiences/overview/","order":0.5,"label":null},{"title":"Connections","path":"/guides/data-warehouse/composable-audiences/connections/","order":1,"label":null},{"title":"Data Models","path":"/guides/data-warehouse/composable-audiences/data-models/","order":2,"label":null}],"metadataParent":{"title":"Data Warehouse","path":"/guides/data-warehouse/","metadataChildren":[{"title":"Composable Audiences","path":"/guides/data-warehouse/composable-audiences/","order":1,"label":null},{"title":"Warehouse Sync","path":"/guides/data-warehouse/warehouse-sync/","order":4,"label":null}],"metadataParent":{"title":"Guides","path":"/guides/","metadataChildren":[{"title":"Platform Overview","path":"/guides/platform-overview/","order":0.5,"label":null},{"title":"Getting Started","path":"/guides/getting-started/","order":1,"label":null},{"title":"mParticle Agent","path":"/guides/mparticle-agent/","order":1.5,"label":null},{"title":"Oversight","path":"/guides/oversight/","order":2,"label":null},{"title":"Data Platform","path":"/guides/data-platform/","order":3,"label":null},{"title":"Data Warehouse","path":"/guides/data-warehouse/","order":4,"label":null},{"title":"Customer 360","path":"/guides/customer-360/","order":5,"label":null},{"title":"Analytics","path":"/guides/analytics/","order":6,"label":null},{"title":"Audiences","path":"/guides/audiences/","order":7,"label":null},{"title":"Settings","path":"/guides/settings/","order":8,"label":null},{"title":"Troubleshooting mParticle","path":"/guides/troubleshooting/","order":10,"label":null},{"title":"Default Service Limits","path":"/guides/default-service-limits/","order":11,"label":null},{"title":"Glossary","path":"/guides/glossary/","order":12,"label":null}],"metadataParent":null}}}}},"markdownRemark":{"html":"<p>Data models define how mParticle queries your warehouse to build composable audiences. Each model is based on a SQL query and specifies which data—such as users, events, or attributes—is available for segmentation.</p>\n<p>Once created, data models act as building blocks for audiences. You can reuse them across multiple audience definitions and link them together to create more advanced segmentation logic.</p>\n<h2 id=\"what-are-data-models\" style=\"position:relative;\"><a href=\"#what-are-data-models\" aria-label=\"what are data models permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>What are data models?</h2>\n<p>Data models define which data from your cloud data warehouse can be used to build audiences in mParticle. Each type of data model plays a different role in audience creation:</p>\n<ul>\n<li><strong>User Data Models</strong><br>\nRepresent your core user or customer records. These models serve as the foundation for all audiences and describe who your users are, using attributes such as signup date, geography, or opt-in status. You must create a user data model before you can use event or generic models.</li>\n<li><strong>Event Data Models</strong><br>\nCapture timestamped user actions such as purchases, logins, or conversions. These models show what your users do over time and must be linked to a user model before they can be used in an audience.</li>\n<li><strong>Generic Data Models</strong><br>\nAdd contextual or supplemental information about your users, such as subscription plans, device types, or account metadata. These models provide extra context and must also be linked to a user model before they can be used in an audience.</li>\n</ul>\n<p>All models are created from SQL queries and tied to a specific cloud data warehouse connection (such as Snowflake, BigQuery, Redshift, or Databricks). Together, user, event, and generic models allow you to combine <strong>user attributes from your warehouse</strong>, <strong>behaviors over time</strong>, and <strong>contextual data</strong> to build precise, flexible audiences.</p>\n<h2 id=\"what-you-can-do-on-the-data-models-page\" style=\"position:relative;\"><a href=\"#what-you-can-do-on-the-data-models-page\" aria-label=\"what you can do on the data models page permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>What you can do on the Data Models page</h2>\n<p>The <strong>Data Models</strong> page, located under <strong>Data Warehouse > Data Models</strong>, shows all models available in your workspace for Composable Audiences.</p>\n<aside>\nThe Data Models page under Data Warehouse currently only shows data models for Composable Audiences.\n<br/>\n<br/>\nTo create or modify a data model for a Warehouse Sync connection (for example, when ingesting data into the mParticle CDP from a data warehouse), navigate to the Warehouse Sync setup wizard by navigating to <b>Data Platform > Setup > Inputs</b> and selecting the Feeds tab. See the <a href=\"/guides/data-warehouse/warehouse-sync/setup/\">Warehouse Sync User Guide</a> for more info.\n</aside>\n<p>From this page, you can:</p>\n<ul>\n<li>View all models created in your workspace</li>\n<li>Check the type, structure, and connection for each model</li>\n<li>Create new data models</li>\n<li>Review model metadata, such as primary key and relationships</li>\n<li>Click into any model to view, edit, or delete it</li>\n</ul>\n<p><img src=\"/images/guides/composable-audiences/data-models-overview.png\"></p>\n<h2 id=\"create-a-new-data-model\" style=\"position:relative;\"><a href=\"#create-a-new-data-model\" aria-label=\"create a new data model permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Create a new data model</h2>\n<p>To create a data model:</p>\n<ol>\n<li>Navigate to <strong>Data Warehouse > Data Models</strong> using the left hand navigation.</li>\n<li>Click <strong>+ Add Data Model</strong>.</li>\n<li>Choose the model type: <strong>User</strong>, <strong>Event</strong>, or <strong>Generic</strong></li>\n<li>\n<p>Follow the step-by-step instructions for:</p>\n<ul>\n<li><a href=\"/guides/data-warehouse/composable-audiences/data-models/user-data-models\">Creating a user data model</a></li>\n<li><a href=\"/guides/data-warehouse/composable-audiences/data-models/event-data-models\">Creating an event data model</a></li>\n<li><a href=\"/guides/data-warehouse/composable-audiences/data-models/generic-data-models\">Creating a generic data model</a></li>\n</ul>\n</li>\n</ol>\n<h3 id=\"autocomplete\" style=\"position:relative;\"><a href=\"#autocomplete\" aria-label=\"autocomplete permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Autocomplete</h3>\n<p>If you enable <strong>autocomplete</strong> for a column in a data model, mParticle temporarily caches the most common values from that column. These values are held for up to 7 days and then purged on a rolling basis. Autocomplete must be explicitly enabled for each column, and doing so makes it easier to build audiences by suggesting common values from your warehouse as you type.</p>\n<h2 id=\"viewing-and-managing-models\" style=\"position:relative;\"><a href=\"#viewing-and-managing-models\" aria-label=\"viewing and managing models permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Viewing and managing models</h2>\n<p>The table on the <strong>Data Models</strong> page includes key information for each model:</p>\n<table>\n<thead>\n<tr>\n<th>Column</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Model Name</strong></td>\n<td>The name of the data model. Click to view or edit the model configuration.</td>\n</tr>\n<tr>\n<td><strong>Type</strong></td>\n<td>The model type—either <strong>Users</strong>, <strong>Events</strong>, or <strong>Generic</strong>.</td>\n</tr>\n<tr>\n<td><strong>Connection</strong></td>\n<td>The warehouse connection the model uses. Must be active and healthy for audiences to refresh successfully.</td>\n</tr>\n<tr>\n<td><strong>Primary Key</strong></td>\n<td>The unique identifier for each user or record (e.g., <code class=\"language-text\">user_id</code>, <code class=\"language-text\">event_id</code>).</td>\n</tr>\n<tr>\n<td><strong>Relationships</strong></td>\n<td>Number of relationships this model has with others. Relationships link models for joined audience logic.</td>\n</tr>\n<tr>\n<td><strong>Created</strong></td>\n<td>Timestamp of when the model was created.</td>\n</tr>\n<tr>\n<td><strong>Created By</strong></td>\n<td>The user who created the model.</td>\n</tr>\n</tbody>\n</table>\n<p>To delete a model, hover over its row, click the <strong>three-dot menu</strong>, and select <strong>Delete</strong>.</p>\n<aside>\nDeleting a data model may break any audiences that depend on it.\n</aside>\n<h2 id=\"model-relationships\" style=\"position:relative;\"><a href=\"#model-relationships\" aria-label=\"model relationships permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Model relationships</h2>\n<p>Creating relationships between data models allows you to join datasets (such as linking events or subscriptions to users) so you can define more complex audience criteria. Relationships are established by specifying a <strong>shared field (key)</strong> that exists in both models, for example a <code class=\"language-text\">user_id</code> column.</p>\n<p>Relationships must be created <strong>after</strong> both models exist. Only user models can stand alone. You must define at least one relationship to use event or generic models in an audience. For example:</p>\n<ul>\n<li>Link an <strong>event model</strong> (such as Orders) to a <strong>user model</strong> via <code class=\"language-text\">user_id</code> to create an audience of users who completed a specific action.</li>\n<li>Link a <strong>generic model</strong> (such as Subscription Plans) to a <strong>user model</strong> to segment users by account type.</li>\n</ul>\n<p>Without these relationships, mParticle would not know how to connect activities or attributes back to the correct user record.</p>\n<h3 id=\"example-linking-users-to-their-purchases\" style=\"position:relative;\"><a href=\"#example-linking-users-to-their-purchases\" aria-label=\"example linking users to their purchases permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Example: Linking users to their purchases</h3>\n<p>Imagine you have created two data models:</p>\n<ul>\n<li>A <strong>User Data Model</strong> that contains one row per customer, with fields like <code class=\"language-text\">user_id</code>, <code class=\"language-text\">email</code>, and <code class=\"language-text\">loyalty_tier</code>.</li>\n<li>An <strong>Event Data Model</strong> that contains one row per order, with fields like <code class=\"language-text\">order_id</code>, <code class=\"language-text\">user_id</code>, <code class=\"language-text\">purchase_date</code>, and <code class=\"language-text\">order_value</code>.</li>\n</ul>\n<p>By creating a <strong>one-to-many relationship</strong> between the <code class=\"language-text\">user_id</code> in your User model and the <code class=\"language-text\">user_id</code> in your Orders model, you make it possible to build an audience such as <em>“all Gold loyalty tier users who have made more than 3 purchases in the last 90 days.”</em></p>\n<h3 id=\"how-to-create-a-relationship\" style=\"position:relative;\"><a href=\"#how-to-create-a-relationship\" aria-label=\"how to create a relationship permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>How to create a relationship</h3>\n<ol>\n<li>Navigate to <strong>Data Warehouse > Data Models</strong>.</li>\n<li>Click the name of the model you want to start from (for example, your User model).</li>\n<li>Open the <strong>Relationships</strong> tab and click <strong>+ Add Relationship</strong>.</li>\n</ol>\n<p><img src=\"/images/guides/composable-audiences/data-models-overview-add-relationship-1.png\"></p>\n<ol start=\"4\">\n<li>Select the <strong>target model</strong> you want to link (for example, your Orders model).</li>\n<li>Choose the <strong>source column</strong> from your starting model and the <strong>target column</strong> from the other model that share the same identifier (for example, <code class=\"language-text\">user_id</code> → <code class=\"language-text\">user_id</code>).</li>\n<li>\n<p>Choose the <strong>cardinality</strong> of the relationship:</p>\n<ul>\n<li><strong>One-to-One</strong>: Each record in the first model relates to exactly one record in the second (for example, User ↔ Loyalty Profile).</li>\n<li><strong>One-to-Many</strong>: Each record in the first model can relate to many in the second (for example, User ↔ Orders).</li>\n</ul>\n</li>\n<li>Click <strong>Add another relationship</strong> to add additional relationships, and click <strong>Save Data Model</strong> when you’re done.</li>\n</ol>\n<h3 id=\"example-data-model-relationships\" style=\"position:relative;\"><a href=\"#example-data-model-relationships\" aria-label=\"example data model relationships permalink\" class=\"anchor before\"><svg width=\"16px\" height=\"17px\" viewBox=\"0 0 16 17\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n                <g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n                    <g id=\"Icon/Link\" fill=\"#98A0A3\" fill-rule=\"nonzero\">\n                        <g id=\"link\">\n                            <path d=\"M9.5,12.4 C9.6,12.4 9.7,12.4 9.9,12.4 C9.8,12.5 9.8,12.5 9.7,12.6 L7.5,14.8 C5.8,16.5 3,16.5 1.3,14.8 C-0.4,13.1 -0.4,10.3 1.3,8.6 L3.5,6.4 C3.6,6.3 3.6,6.3 3.7,6.2 C5,5 6.9,4.8 8.4,5.5 C8.8,5.7 9.3,6 9.6,6.4 C10,6.7 10.2,7.2 10.5,7.6 C10.2,7.9 9.9,8 9.5,8 C9.4,8 9.2,8 9.1,7.9 C8.9,7.5 8.5,7.2 8.1,6.9 C7,6.2 5.5,6.4 4.5,7.3 L3.8,8 L2.3,9.5 C1.2,10.6 1.2,12.5 2.3,13.6 C3.4,14.7 5.3,14.7 6.4,13.6 L7.9,12.1 C8.4,12.3 8.9,12.4 9.5,12.4 Z M14.7,1.3 C13,-0.4 10.2,-0.4 8.5,1.3 L6.3,3.5 C6.2,3.6 6.2,3.6 6.1,3.7 C6.7,3.7 7.4,3.7 8,3.9 L9.5,2.4 C10.6,1.3 12.5,1.3 13.6,2.4 C14.7,3.5 14.7,5.4 13.6,6.5 L12.1,8 L11.4,8.7 C10.4,9.7 8.9,9.8 7.8,9.1 C7.4,8.9 7.1,8.5 6.8,8.1 C6.7,8.1 6.5,8 6.4,8 C6,8 5.6,8.2 5.4,8.4 C5.6,8.8 5.9,9.3 6.3,9.6 C6.6,10 7.1,10.2 7.5,10.5 C9,11.2 10.9,11 12.3,9.8 C12.4,9.7 12.4,9.7 12.5,9.6 L14.7,7.4 C16.4,5.7 16.4,3 14.7,1.3 Z\" id=\"Shape\"></path>\n                        </g>\n                    </g>\n                </g>\n            </svg></a>Example data model relationships</h3>\n<p>In the example below, the <strong>Users</strong> data model has been linked to both the <strong>Orders</strong> event and the <strong>Subscriptions</strong> generic data model through the shared <strong>USER_ID</strong> column.</p>\n<ul>\n<li>The Users → Orders relationship is set as <strong>One-to-Many</strong>, since a single user can place many orders.</li>\n<li>The Users → Subscriptions relationship is <strong>One-to-One</strong>, since each user has at most one active subscription record.</li>\n</ul>\n<p><img src=\"/images/guides/composable-audiences/data-models-overview-add-relationship-2.png\"></p>\n<p>These relationships are powerful because they allow you to build audiences that combine different perspectives on your users. For example, “Gold loyalty tier users who made more than three purchases in the last 90 days” or “Premium plan subscribers whose renewal date is within 30 days but have auto-renew turned off.”</p>\n<p>Without these relationships, mParticle would not be able to connect purchase or subscription records back to individual users.</p>\n<aside class=\"warning\">\nIf a column used in a relationship is renamed or removed in your warehouse, the relationship (and any audiences that depend on it) will break. Always coordinate schema changes with your data team.  \n<br/><br/>\nRelationships do not duplicate your data. They simply tell mParticle how to connect the dots between models when evaluating audience criteria.  \n</aside>","frontmatter":{"title":"Data Models Overview","order":1,"seoTitle":null,"seoDescription":null},"parent":{"__typename":"File","modifiedTime":"October 12, 2026"}}},"pageContext":{"slug":"/guides/data-warehouse/composable-audiences/data-models/overview/"}},"staticQueryHashes":["2950460867"]}