# Use the SQL Editor

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: Use the SQL Editor
latest-operator-version: v26.2.1
latest-console-tag: v3.9.0
latest-connect-version: 4.104.0
latest-redpanda-tag: v26.2.1
docname: query-data/sql-editor
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: query-data/sql-editor.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/sql/pages/query-data/sql-editor.adoc
description: Write and run SQL queries against your Redpanda topics directly from Redpanda Cloud Console without a separate SQL client.
page-topic-type: how-to
personas: app_developer, data_engineer, platform_admin
learning-objective-1: Add a topic to the SQL catalog using the wizard in the SQL editor
learning-objective-2: Navigate SQL catalogs and inspect table schemas from the Console SQL editor
learning-objective-3: Write and run a SELECT query and view the results
page-git-created-date: "2026-07-09"
page-git-modified-date: "2026-07-09"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/sql/query-data/sql-editor.md -->

The Redpanda Cloud Console includes a built-in SQL editor. You can write and run queries against your Redpanda topics without installing a separate PostgreSQL client. The editor connects to your cluster’s SQL engine using your existing Console session, so no separate credentials are required.

After reading this page, you will be able to:

-   Add a topic to the SQL catalog using the wizard in the SQL editor

-   Navigate SQL catalogs and inspect table schemas from the Console SQL editor

-   Write and run a SELECT query and view the results


## [](#prerequisites)Prerequisites

-   A Redpanda BYOC cluster with the SQL engine enabled. See [Enable Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/get-started/deploy-sql-cluster/).

-   A Redpanda Cloud user with the **SQL: Access** or **SQL: Manage** [RBAC](https://docs.redpanda.com/cloud-data-platform/reference/glossary/#rbac) permission. Users with **SQL: Access** also need a `GRANT SELECT` on each table to run queries against it. See [Manage access to Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/manage/manage-access/).

-   At least one topic mapped to a SQL table in the catalog. See [Query Streaming Topics](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-streaming-topics/), or use the [Add a topic](#add-topic) wizard in the editor.


## [](#open-the-sql-editor)Open the SQL editor

In Redpanda Cloud Console, navigate to your cluster and select **SQL** in the left navigation menu. The SQL workspace opens with the catalog panel on the left and the editor and results panels on the right.

## [](#browse-the-catalog-tree)Browse the catalog tree

The catalog panel lists every SQL catalog attached to your cluster.

Click a catalog to expand it, then expand a namespace to see its tables. To view a table’s columns and data types, click the chevron (>) next to the table name.

Within the Redpanda catalog, tables backed by [Iceberg-enabled topics](https://docs.redpanda.com/cloud-data-platform/reference/glossary/#iceberg-topic) display an **Iceberg** badge. When you query one of these tables, the SQL engine automatically bridges live topic data with the Iceberg history. See [Query Iceberg topics](#query-iceberg-topics).

To filter tables by name, type in the **Search tables** box at the top of the catalog panel. The filter applies across all catalogs and namespaces.

To open a `SELECT *` query for a table in the editor, click the run button (▶) beside the table name.

## [](#write-and-run-a-query)Write and run a query

### [](#query-tabs)Query tabs

The editor supports multiple independent query tabs. To add a tab, click **+** in the tab bar. To close a tab, click the **×** on the tab.

### [](#syntax-highlighting-and-autocomplete)Syntax highlighting and autocomplete

SQL keywords, functions, and string literals are highlighted as you type. Begin typing an identifier to see autocomplete suggestions for table names, column names, and SQL keywords. Use the arrow keys to navigate the suggestion list and press Tab or Enter to accept a suggestion. Press Escape to dismiss the list.

### [](#format-and-history)Format and history

Click **Format** to reformat the query in the active tab with consistent keyword casing and clause line breaks.

Click **History** to see the last 40 queries run in this browser. Your browser stores query history locally. History does not sync across devices or user sessions.

### [](#run-a-query)Run a query

To run the query in the active tab, click **Run** or press Cmd+Enter (macOS) or Ctrl+Enter (Windows and Linux).

To run a portion of the query, select the text you want to run, then click **Run selection**.

Because Redpanda SQL is a read-only query engine, the SQL editor supports only `SELECT` statements. `CREATE TABLE` and permission statements (`GRANT`, `REVOKE`) are not available in the editor. Use the [Add a topic wizard](#add-topic) to create tables and [Manage access](https://docs.redpanda.com/cloud-data-platform/sql/manage/manage-access/) to manage grants.

## [](#view-results)View results

After a successful query, the results panel shows:

-   A status bar with a success indicator, the total row count, and the elapsed query time.

-   A results grid with one column per returned field.


Each column header shows the column name and its data type. To sort results, use `ORDER BY` in your query. The results grid does not support column sorting.

`NULL` values render as a distinct `NULL` label in each cell.

To view structured data in full, click a cell that contains JSON or a nested value. The results panel displays the value formatted for readability.

Scroll the results grid to view all rows. If the server’s row limit is reached, a **Truncated** badge appears in the status bar.

### [](#query-iceberg-topics)Query Iceberg topics

When a query reads from an Iceberg-enabled topic in the Redpanda catalog, a **Bridge query** chip appears in the results status bar. This means the query returned data from both the live Redpanda topic and its Iceberg committed history.

If there are messages not yet committed to Iceberg, a message below the status bar shows approximately how many offsets are not yet in Iceberg at the time the query ran.

For details on querying across live and Iceberg-tiered data, see [Query Iceberg-enabled Topics](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-iceberg-topics/).

## [](#export-results)Export results

To download the current result set, click the export buttons in the results status bar:

-   CSV: Downloads a comma-separated file named `query_result.csv`.

-   JSON: Downloads a JSON array named `query_result.json`.


The download includes all returned rows.

## [](#add-topic)Add a topic to the catalog

> 📝 **NOTE**
>
> This task requires the Admin role.

To make a Redpanda topic queryable from the editor, add it to the `default_redpanda_catalog` with the **Add a topic** wizard:

1.  In the catalog panel, click **Add a topic** at the bottom of the Redpanda catalog namespace.

2.  In the **Choose a topic** step, select the Redpanda topic to expose as a SQL table. Topics with Iceberg tiering enabled show an **Iceberg** badge.

3.  Click **Continue**.

4.  In the **Name the table** step, confirm or edit the table name. Table names must start with a letter or underscore and can contain only lowercase letters, numbers, and underscores. The catalog and source topic are fixed.

5.  Review the `CREATE TABLE` statement that will run, then click **Create table**.


The table appears in the catalog panel immediately and is ready to query.

## [](#suggested-reading)Suggested reading

-   [Query Streaming Topics](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-streaming-topics/): Map topics to SQL tables and run queries from a `psql` client.

-   [Query Iceberg-enabled Topics](https://docs.redpanda.com/cloud-data-platform/sql/query-data/query-iceberg-topics/): How bridge queries mesh live and Iceberg-tiered data.

-   [Manage access to Redpanda SQL](https://docs.redpanda.com/cloud-data-platform/sql/manage/manage-access/): Grant users `SELECT` access to tables.

-   [Redpanda SQL Reference](https://docs.redpanda.com/cloud-data-platform/reference/sql/): Supported statements, clauses, functions, data types, and operators.