Supabase SQL Editor: inspect tables and query data

By Anil Gautam · Published and reviewed September 20, 2026

Open Supabase SQL Editor to query your project’s PostgreSQL database in the browser. Start with a small read query and check the result. Before working with real tables, confirm the project and database role you’re using.

Open the right workspace

Open your Supabase project, choose SQL Editor, and start a new query. The official SQL Editor overview describes the browser workspace. Use a separate query for inspection. That makes it easier to avoid running an update or migration by accident.

First check the current database identity and schema context. This does not list credentials:

SELECT current_database(), current_user, current_schema();

A database name alone may not distinguish your projects. Compare the selected project in the dashboard too, and give saved queries names that state their purpose, such as “weekly task count,” rather than “query 7.”

Try a query without creating a table

This self-contained example creates no database objects. The rows exist only within the query, making it useful for learning filtering and sorting:

WITH tasks(id, title, status) AS (
  VALUES (1, 'Review schema', 'open'),
         (2, 'Export sample', 'done'),
         (3, 'Check connection', 'open')
)
SELECT id, title
FROM tasks
WHERE status = 'open'
ORDER BY id
LIMIT 20;

The expected result contains IDs 1 and 3. Change the filter to 'done' and the result becomes ID 2. Keeping the fixture small makes it possible to check the answer by eye before adapting the pattern to real data.

Adapt the query to your schema

Find your real column names using the database viewing guide. Replace the example’s input with a schema-qualified table such as public.tasks. Select a few relevant columns and keep the limit while exploring. If names contain uppercase letters or spaces, PostgreSQL’s quoted identifiers must match them exactly.

To count rows by status in that illustrative schema:

SELECT status, count(*) AS task_count
FROM public.tasks
GROUP BY status
ORDER BY task_count DESC, status;

This returns a summary, not a page of individual tasks. A limit on output rows would not stop the aggregate from reading its input. On a large table, use an appropriate date filter and inspect the plan before repeatedly running an expensive query.

Check which role ran the query

A successful administrator query does not reproduce a signed-in user’s API request. Record the database role, filters and expected row count when diagnosing differences. Our NULL filtering guide explains a common reason that an apparently simple predicate omits rows.

Use EXPLAIN when you need to understand a query plan. EXPLAIN ANALYZE executes the statement, including changes in a modifying statement. Read the plan-reading guide before applying it to unfamiliar SQL.

When a desktop editor helps

For repeated work across databases, a desktop client can keep connections and query work in one place. The database still enforces permissions. plainDB’s Supabase client page describes its scope, and the connection instructions explain which credentials to use. Keep Supabase Studio for platform administration.

How we write and review guides · Try plainDB