> For the complete documentation index, see [llms.txt](https://cleyrop.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cleyrop.gitbook.io/docs/documentation-fr-en/data-and-ai-project/exploration-sql.md).

# SQL Exploration

The tab **SQL Exploration** allows you to perform **exploratory analyses** on your datasets using simple SQL queries, without immediately creating a Dataflow.

It is an ideal space for testing filters, validating joins, or preparing transformations before operationalizing them.

***

## Run a SQL query

1. Select the dataset you want to work on.
2. Write your SQL query in the editor.
3. Click Run query to execute the script.

{% hint style="warning" %}
If a SQL reserved word (e.g. ORDER, TABLE, GROUP) is used as a column or dataset name, you must escape it with quotes.\
Example: SELECT "order" FROM project."table"
{% endhint %}

**Example:**

```sql
SELECT *
FROM "Social Benefits"
WHERE codgeo = 1001;
```

### View results

Once the query is executed, the result is displayed directly below the SQL editor.

You can view up to 200 maximum rows from the queried dataset.

This lets you quickly validate your filters, aggregations, or joins before moving on to a more complete transformation step.

{% hint style="info" %}
The results do not modify the original dataset — it is only a temporary view.
{% endhint %}

### Convert a query into a Dataflow

Once your analysis is validated, you can transform your SQL query into a complete Dataflow to integrate it into your data processing workflows.

1. Click Convert to Dataflow.
2. A pop-up opens: enter the name of the Dataflow and the output dataset.
3. Confirm creation.<br>

The platform automatically creates:

* a new Dataflow based on your SQL query,
* and an output dataset containing the result of the transformation.

***

## Best practices

* Use SQL Exploration to quickly test your logic before automating it.
* Name your Dataflows clearly (e.g. nettoyage\_aides\_sociales\_sql).
* Check the schema consistency (column types) before publishing your datasets.
