# Query

The "**Query"** is a task that can retrieve data from [SQL-based integrations](/integrations/connecting-a-data-source.md) and write to it.

For retrieving the data you can either write an SQL query you want or use a constructor of queries if the desired query is simple enough:

How to **SELECT** data with a UI-constructor:

<figure><img src="/files/MxTM7ZAmaKt2lOs1BY0N" alt=""><figcaption></figcaption></figure>

How to do the same with SQL query:

<figure><img src="/files/nx4wmV34wAKDdGC4ncVr" alt=""><figcaption></figcaption></figure>

How to **UPDATE** or **INSERT** a dataset into a database:

<figure><img src="/files/kJjlrb4pzUT34KZkdyWG" alt=""><figcaption></figcaption></figure>


---

# 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.ylem.co/pipelines/tasks-ip/query.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.
