> For the complete documentation index, see [llms.txt](https://docs.corraldata.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.corraldata.com/kb/explore-your-data/sql-client.md).

# SQL Client

Want to work with your warehouse directly? The built-in SQL Client gives you a full query workspace inside CorralData — no external tools, no separate credentials.

### How it works

Open **SQL Client** from the left sidebar and start writing. As you work you get:

* **A schema browser** in the sidebar — click through your schemas, tables, and columns, and insert table names straight into your query.
* **Autocomplete** for table and column names as you type.
* **Run selection** — highlight part of a query and run just that piece.
* **A date picker for date-range substitution** — write queries with date tokens and control the period from the picker instead of editing the SQL each time.
* **Optional auto-linting and formatting** — toggle it on to keep your SQL tidy, or off to keep every character exactly as you wrote it.
* **Draft protection** — your in-progress query is kept if you navigate away and come back.

### Turn a query into something permanent

A good query shouldn't die in the editor. From the SQL Client you can save your result as:

* **A data model** — a reusable definition other widgets and AI answers can build on (see [Verified Data Models](https://docs.corraldata.com/kb/organize-your-data/verified-data-models))
* **A widget** — drop the result onto a Board as a chart or table

{% hint style="success" %}
**Tip:** You don't have to write the SQL yourself. Ask AskCorral to draft the query, then open it in the SQL Client to inspect, tweak, and save it.
{% endhint %}

{% hint style="info" %}
If you're having trouble and require technical assistance, feel free to reach out to <support@corraldata.com>.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.corraldata.com/kb/explore-your-data/sql-client.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
