# Manipulations

### Overview

This procedure executes a SQL query on a table and returns the result.

### Input Concepts

| Concept     | Type   | Description                                                                 | Default    | Required |
| ----------- | ------ | --------------------------------------------------------------------------- | ---------- | -------- |
| `table`     | table  | The table to be queried.                                                    | No default | Yes      |
| `sql query` | string | The SQL query to execute on the table, enclosed in quotes. \[SQLite syntax] | No default | Yes      |

### Output Concepts

| Concept | Description                                        |
| ------- | -------------------------------------------------- |
| `table` | The resulting table after executing the SQL query. |

### Examples

#### 1. Query a Sample Table

{% tabs %}
{% tab title="Automation" %}

```
create a sample table
query the table with
    the sql query is "SELECT Name, Number, UPPER(Address) AS Address, REPLACE(REPLACE(City, 'San', 'SFO'), 'Jose', 'JOS') AS City FROM sample table"
```

{% endtab %}

{% tab title="Results" %}

| Name          | Number            | Address          | City          |
| ------------- | ----------------- | ---------------- | ------------- |
| John          | +1 (415) 691 9426 | 123 EAST STREET  | SFO Francisco |
| Joe           | +1 (415) 691 1234 | 321 WEST STREET  | SFO JOS       |
| Jack          | +1 (415) 691 4595 | 213 NORTH STREET | SFO Francisco |
| {% endtab %}  |                   |                  |               |
| {% endtabs %} |                   |                  |               |


---

# 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.kognitos.com/legacy/legacy-experience/automation-areas/tables-v2/query-a-table.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.
