# 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 %} |                   |                  |               |
