> For the complete documentation index, see [llms.txt](https://endash-guidance-docs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://endash-guidance-docs.gitbook.io/docs/data/data-model-details/build-data-model.md).

# Build - Data model

## Overview

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FsSkbsjs0HGJzXLb6DEgf%2Fimage.png?alt=media&amp;token=aa48f712-956b-4642-94ab-7fd0b7caad61" alt=""><figcaption></figcaption></figure>

* Click on the Build tab.

## Query your data model with SQL

### Execute

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FsyuEDl8TUhEgoZW3inkF%2Fimage.png?alt=media&amp;token=427ac2f3-7252-4894-b0b4-c5d8a3fe335c" alt=""><figcaption></figcaption></figure>

* Click on the Execute button.

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FaVjhoFFe2tgcBs2MlCyw%2Fimage.png?alt=media&amp;token=4336ea39-188f-4e50-b260-484a2a8689e3" alt=""><figcaption></figcaption></figure>

* A toast message will notify if succeeded.

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FwQmNq4nj5P9bCibQmR7P%2Fimage.png?alt=media&amp;token=4babfb7d-017f-426d-9867-8fab169585a7" alt=""><figcaption></figcaption></figure>

* A Toast message shows where the query wrong if not succeed&#x20;

### Discard

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2Flxqh7OznggOjlJGrxFxb%2Fimage.png?alt=media&amp;token=cf973a18-f8cb-4108-bdae-90e19b32a12e" alt=""><figcaption></figcaption></figure>

* Click the Discard button to revert back your query.

### Save

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FovqNFGaYXodFyv8VXqlM%2Fimage.png?alt=media&amp;token=48393d98-abf6-4223-8830-4e36a731caab" alt=""><figcaption></figcaption></figure>

* Click the Save button to save the query of that Data model.

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FzYpZlprIJyOV4vozHxKe%2Fimage.png?alt=media&amp;token=bcc1e130-b75c-4ad0-9685-bf79c74452a2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please refresh your dashboard later if any.
{% endhint %}

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FnUB5Mv6aIX7AEXw2luzR%2Fimage.png?alt=media&amp;token=27bcb15d-5a1d-4a25-8a58-477c71f71ddf" alt=""><figcaption></figcaption></figure>

* A pop-up will ask you to save change the query or dismiss it.

## Constraint rules

### Upstream data and Downstream data

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2F5L3umcn1xuIsHDGSeETy%2Fimage.png?alt=media&amp;token=81a0239c-749c-47de-96bf-c8f2b1a1b205" alt=""><figcaption></figcaption></figure>

* Click on the Insert button of a data model to query it.

<figure><img src="https://1608311007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSr8m3Ldc2W7Qqq1jsjgC%2Fuploads%2FpIktW1Yzw6rOOXNrSATE%2Fimage.png?alt=media&amp;token=46fc654c-e21a-4df9-a09e-53d8f5674280" alt=""><figcaption></figcaption></figure>

* If you modify an Upstream, it can affect the downstream data.

## 👋 Need help?

{% hint style="info" %}
If you need help querying a specific data model that suits your needs but is unfamiliar with SQL, you can use our [AI query](/docs/data/build-and-modify-a-data-model-with-our-ai-query.md) or [contact](/docs/need-more-help/contact-us.md) us and we will support you.
{% endhint %}
