---
title: "Use the SQL editor"
description: "The Analytics Manager SQL editor lets you use SQL to write query statements on either your databases, or directly on sources"
url: https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/analytics-manager-queries-sql-editor
lang: pt
lastUpdated: 2026-09-14
---
> For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pt/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pt/llms-full.txt.

# Use the SQL editor

## Objective

The Analytics Manager SQL editor lets you use [SQL](https://en.wikipedia.org/wiki/SQL) to write query statements on either your databases, or [directly on sources](#query-data-sources-directly). SQL queries can join data located on multiple different [datasets](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/lakehouse-manager-datasets.md) or [sources](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/landing-page-connectors-sources.md).

To use the SQL editor, click on **SQL** in the header of a query.

:::warning
After you switch a query to the SQL mode, it is impossible to switch it back to the visual mode.
:::

![Sql switch](/images/public-cloud/data-platform/product/am/queries/picts/sql-switch.png)
At the moment, SQL editor can only return results in table format. It cannot be used for charts.

## Write queries in the SQL editor

The SQL editor only supports statements written in ANSI-compliant SQL syntax, that start with a _SELECT_ clause.

As you type, the editor suggests SQL keywords, ready-made snippets for common statement shapes, and every Trino function available to your queries, each with a short description of what it does. Pick a suggestion to insert it at the cursor.

![Write queries in the SQL editor — Sql overview](/images/public-cloud/data-platform/product/am/queries/picts/sql-overview.png)
### Query stored databases

To query data stored in your Project's tables, use standard SQL statements to refer to the attributes and tables you want to select:

To reference **a table**, simply use its name as entered in the [Lakehouse Manager](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/lakehouse-manager-tables.md).

```sql
SELECT * FROM my_table
```

To reference **an attribute**, simply use its name as entered in the [Lakehouse Manager](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/lakehouse-manager-attributes.md).

```sql
SELECT my_attribute FROM my_table
```

You can use the widget on the left of the screen to find and copy the exact name of tables and attributes.

### Query data sources directly

The Analytics Manager can execute queries on your connected data sources [with Direct Query mode activated](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/connectors-sources-configure.md#make-your-data-source-directly-queryable), without importing the data on Data Platform.

To reference **a table** from a source, use the _technical name_ of the source as entered in the [Connectors](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/landing-page-connectors-sources.md) preceded by `db_{projectID}_` and followed by a dot, followed by the _schema_ for this data source (usually the schema name or database name from your connector), followed by a dot, followed by the _name of the table/object_ at it is in the source.

```sql
SELECT * FROM  db_lcibesgk_my_mongodb_source.database_name.my_table
```

To reference **an attribute**, simply use the name it has in the source object.

```sql
SELECT my_attribute FROM db_lcibesgk_my_mongodb_source.database_name.my_table
```

:::info
If the source object's name doesn't also exist in the [Lakehouse Manager Tables](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/lakehouse-manager-tables.md), **you can simply reference it by name** (as if it was stored in the Platform database). However, if there is a table with the same name in the platform, it is necessary to write the _source technical name_ and the _schema_ as explained.
:::

## Discover the response format

When a query is executed through the SQL mode, the results are returned using the following compact format.

```json
[
      [
        "Google",
        501.16340892465297
      ],
      [
        "Facebook",
        512.5209205642168
      ],
      [
        "Snapchat",
        494.96303030302937
      ],
      [
        "Pied Piper",
        492.7505523255817
      ]
]

```

To view the raw response sent by the Analytics Manager when your query is executed, click on the **gear icon** and activate _Display raw response_.

![Discover the response format — Sql raw response](/images/public-cloud/data-platform/product/am/queries/picts/sql-raw-response.png)
## Working with large result sets

Queries execute **asynchronously**: that is how Trino works natively, and the Analytics Manager relies on it. A slow or large query is therefore not a browser-timeout problem.

What can hurt is the **volume of rows returned to the browser**: when a result set is very large, the page tries to load it all into memory at once and may become unresponsive. This is unrelated to the complexity of the query itself. A statement with many `CASE WHEN` clauses runs fine; it is the number of rows displayed that matters.

:::info
**Best practice:** narrow the result set before returning it. Add filters, aggregate, or use `LIMIT`. This keeps the editor responsive.
:::

## Go further

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://www.ovhcloud.com/pt/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.

Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated [Discord channel](https://discord.gg/ovhcloud).

If you need support with your OVHcloud services, create a request in our [Help Centre](https://help.ovhcloud.com/csm?id=csm_get_help).

Join our [community of users](https://community.ovhcloud.com/).
