> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/core-concepts/navigation/dataset-overview/sql-assistant-for-data-quality/about-sql-assistant-for-data-quality.md).

# About SQL Assistant for Data Quality

SQL Assistant for Data Quality allows you to automate SQL rule writing and troubleshooting to help you accelerate the discovery, curation, and visualization of your data. By leveraging the SQL query generation capabilities of SQL Assistant for Data Quality, both advanced and beginner SQL users can quickly discover key data points and insights, and then convert them into rules. Furthermore, the troubleshooting capabilities of SQL Assistant for Data Quality allow you to elegantly correct syntactical mistakes, resolving the once tedious SQL syntax reviews of the past.

You can use SQL Assistant for Data Quality to assist with SQL rule writing and troubleshooting on the following pages:

* [Dataset Overview](/data-quality-self-hosted/core-concepts/navigation/dataset-overview.md)
* [Rule Workbench](/data-quality-self-hosted/core-concepts/dq-rules/rule-builder/working-with-the-rule-workbench/create-a-data-quality-rule.md)

{% hint style="success" %}
This feature is powered by Collibra AI and consumes Collibra Units (CUs). For information on how we leverage AI in our products, including how we handle data used for training and input, please visit the [Collibra Trust Site](https://www.collibra.com/company/trust-center?_gl=1*60hsks*_ga*MTQ5OTc2Mjk5My4xNzIyNDAzNzgx*_ga_FNDVC6N2MC*czE3NzMxMjg2NDEkbzM1NCRnMSR0MTc3MzEyOTQxNiRqNTEkbDAkaDA.#sub-menu-responsible-ai).
{% endhint %}

## Prerequisites

To use SQL Assistant for Data Quality, you need to:

* Have an active integration with Collibra Platform configured on the Admin Console > [Integrations](/data-quality-self-hosted/integrations/configuring-a-new-integration.md) screen.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Only the Credentials step of the Integration Setup is required. You do not need to map connections, tenants, dimensions, or layers to use SQL Assistant for Data Quality.</p></div>
* Set AI\_PLATFORM\_PATH to `TRUE` (default) on the Admin Console > [Application Configuration Settings](/data-quality-self-hosted/admin-configuration/admin-console/configuration-settings/application-configuration-settings.md) screen.
* Set AI\_TENANT to `TRUE` on the Admin Console > [Application Configuration Settings](/data-quality-self-hosted/admin-configuration/admin-console/configuration-settings/application-configuration-settings.md) screen.
* To use the SQL Assistant for Data Quality with an OAuth-based Data Quality & Observability (self-hosted) integration with Collibra Platform, you must have Data Quality & Observability (self-hosted) version 2026.03 or later.
* If you use an OAuth-based integration with Collibra Platform, register the OAuth application with Collibra Platform as the application type. If you register it as an Integration application type, SQL Assistant for Data Quality requests fail with an invalid scope error.
* To generate rule suggestions with SQL Assistant for Data Quality over an OAuth integration, you must use a Platform token. When you register the OAuth application in Collibra Platform, set the application type to **Platform**. An Integration-type application does not receive the scope required for rule suggestion requests, and results in an `invalid_scope` error.

## SQL Assistant for Data Quality flow

{% stepper %}
{% step %}
A user initiates a Collibra AI prompt request from Dataset Overview or Rule Workbench in the Collibra DQ UI.
{% endstep %}

{% step %}
Collibra DQ registers the user and retrieves an OAuth key from their Collibra Platform instance.
{% endstep %}

{% step %}
Collibra DQ makes a request to Collibra Platform to make an LLM request. For more information about Collibra's security, privacy, and responsible AI policies, go to the [Collibra trust center](https://www.collibra.com/company/trust-center#sub-menu-privacy).
{% endstep %}

{% step %}
Google Vertex AI returns a response to Collibra DQ, where it is logged in the [Generative AI Audit Trail](/data-quality-self-hosted/admin-configuration/admin-console/audit-trail/generative-ai-audit-trail.md).
{% endstep %}

{% step %}
The response routes through Collibra DQ, where its contents display in the UI.
{% endstep %}
{% endstepper %}

## Overview of the SQL Assistant for Data Quality components

![Collibra AI screenshot](https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-fc34856eeff0479ed6f18cf2ae1d34c6cf7e18ac%2Fdq-collibra-ai.png?alt=media)

| No.                                                                                                                                                                                                                                     | Component           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-5933195c69103c372a3f185c9e270e26b4ba309e%2F1.png?alt=media" alt="Number 1" data-size="line"> | Collibra AI prompts | <p>Click the drop-down list and select a prompt.</p><ul><li><strong>Generate Rule</strong> creates SQL suggestions based on your plain-text input in the request prompt.</li><li><strong>Troubleshoot Rule</strong> fixes and rewrites queries when there are issues with your SQL.</li><li><strong>Categorical</strong> provides a suggested SQL check to uncover any categorical outliers in the column you specify.</li><li><strong>Dupe</strong> provides a suggested SQL check to uncover any duplicate values in the column you specify.</li><li><strong>Record</strong> provides a suggested SQL check to uncover any values that appear on a previous day but not the next.</li><li><strong>Pattern</strong> provides a suggested SQL check to uncover infrequent combinations that appear less than 5 percent of the time in the columns you specify.</li><li><strong>Frequency Distribution</strong> provides a SQL check to uncover the frequency distribution of all values within a column.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-843a8161663d64df0f0670703a7da8a15fa4742a%2F2.png?alt=media" alt="Number 2" data-size="line"> | Reset prompt        | Click <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-e157d013ffc7b07f6a4cf53e1f0c93edc1e70ef2%2Frefresh-large%402x.png?alt=media" alt="" data-size="line"> to reset your request prompt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-410256a9a3ec171f5856e3095fb7197a56ef01cc%2F3.png?alt=media" alt="Number 3" data-size="line"> | Request prompt      | <p>An input field where you can view dataset metadata and enter a prompt for SQL Assistant for Data Quality in plain-text format. There are three main sections in the request prompt:</p><ul><li><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-0e65c9ad1732ffec8639efbb778fdd7e4885ad1c%2FA.png?alt=media" alt="" data-size="line">: The name of the table. This is typically one of the details before the <code>WHERE</code> clause in a SQL query.</li><li><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-450fd80bc2bce73d32065ee61901f853eb6a3c12%2FB.png?alt=media" alt="" data-size="line">: The columns in the table that are available to query.</li><li><p><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-7819f71ed604b4f53e84cfe794adc6ee16c44968%2FC.png?alt=media" alt="" data-size="line">: The input field where you can enter a prompt for SQL Assistant for Data Quality to generate a SQL suggestion.</p><p>Click the empty space at the bottom of the input field to place your cursor in the correct request prompt location.</p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>When many columns exist in your dataset, you may need to scroll to the bottom of the request prompt to enter your desired query criteria.</p></div></li></ul> |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-4bdd8c63c36192a5135af32ef072c0ffacc082f4%2F4.png?alt=media" alt="number 4" data-size="line"> | Results             | The results that SQL Assistant for Data Quality returns based on the contents of your prompt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-f4b4dd0018a3a448188a4f6669ca40f0646fe93b%2F5.png?alt=media" alt="Number 5" data-size="line"> | Action buttons      | <ul><li>Click <strong>Submit to Collibra AI</strong> to generate a SQL rule suggestion.</li><li>Click <strong>Copy to Editor</strong> to automatically apply the suggested query to the SQL editor.</li><li>Click <strong>Copy to Clipboard</strong> to copy the suggested query to your computer's clipboard, allowing you to paste the query elsewhere.</li><li>Click <strong>Close</strong> to exit the SQL assistant without copying the suggested query.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
