> For the complete documentation index, see [llms.txt](https://docs.feedloop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.feedloop.ai/agent-utility/resource/data-connector/sql-generation-and-modification.md).

# 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'
```
