> For the complete documentation index, see [llms.txt](https://docs.skydeck.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.skydeck.ai/zh-cn/genstudio-workspace/tools/sql-assistant/how-to-use.md).

# 如何使用

要开始使用 SQL Assistant，您需要提供一个数据定义语言（DDL）段和任务描述。

* **DDL** **段** – 一组 SQL 命令、对象、属性和约束的子集，专注于定义或修改数据库对象的结构。
* **任务描述** – 与 DDL 相关的指令，告诉 SQL Assistant 您需要什么帮助。

<figure><img src="/files/VOpb2lCGb0ENvlrZHt98" alt="sql assistant 2"><figcaption></figcaption></figure>

每当您与 SQL Assistant 创建新聊天时加载的默认占位符提示，展示了如何创建您自己的提示：

* DDL 语句创建了一个名为 ‘transactions’ 的表，包含 5 列（transaction\_id、customer\_id、transaction\_date、amount 和 description）。
* 任务描述要求 SQL Assistant 提供一个查询，打印所有超过 1000 美元的交易。


---

# 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.skydeck.ai/zh-cn/genstudio-workspace/tools/sql-assistant/how-to-use.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.
