# Query

The "**Query"** is a task that can retrieve data from [SQL-based integrations](https://docs.ylem.co/integrations) 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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FezQDkTfV8HlbwCWcW1KA%2FScreenshot%202024-04-29%20at%2022.03.14.png?alt=media&#x26;token=cba143cd-cc4b-4fd7-bc6a-a9343d58052d" alt=""><figcaption></figcaption></figure>

How to do the same with SQL query:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2Fy2TgfEu4KcMUTDkRQWSD%2FScreenshot%202024-04-29%20at%2022.03.24.png?alt=media&#x26;token=b94a313d-bfa1-47a9-8b98-0732cd10587b" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FJZPI78jCfVTZWiiW00bt%2Fr16.png?alt=media&#x26;token=224e576c-9a95-48db-85b4-9db813a08178" alt=""><figcaption></figcaption></figure>
