# SQL generation and modification

### SQL Generation

After filling in relevant questions within the context, in this case, healthcare, you can press the '<mark style="color:blue;">Generate</mark>' button to proceed. After generating questions, the system will automatically generate SQL, which will then appear in the SQL column.

<figure><img src="/files/XkFGuFHZEHsG4BVYBLdw" alt="" width="399"><figcaption></figcaption></figure>

As a result, we have the following SQL query:

```sql
SELECT * FROM "stagging-qore-data-potato-712352".test
WHERE lokasi = 'Bandung'
```

### SQL Modification

After filling in relevant questions within the context, proceed by pressing the '<mark style="color:blue;">Execute</mark>' button. Following the generation of questions, the system will automatically generate SQL. However, if we wish to modify the SQL query, simply click the <mark style="color:blue;">**SQL section**</mark> and then make the necessary changes to the SQL query.

<figure><img src="/files/2ACQ0isE7SNcFD69GGqG" alt="" width="409"><figcaption></figcaption></figure>

{% hint style="info" %}
We can modify the generated SQL query from the previous questions by clicking on the **SQL section**. Afterward, we can **edit the SQL** according to our specific needs.
{% endhint %}

You can try modifying the existing SQL query in the box according to your needs. For example, you can change the location you want to retrieve by replacing 'Bandung' with 'Semarang'.

```sql
SELECT * FROM "stagging-qore-data-potato-712352".test
WHERE lokasi = 'Bandung'
```

We can modify the query to retrieve data from the location 'Semarang' look like this.

```sql
SELECT * FROM "stagging-qore-data-potato-712352".test
WHERE lokasi = 'Semarang'
```


---

# Agent Instructions: 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:

```
GET https://docs.feedloop.ai/agent-utility/resource/data-connector/sql-generation-and-modification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
