SQL editor: precise questions for your business data

Write read-only SQL across all tables of your organization, browse tables and columns, save queries under a name and turn results into charts, CSV files or new tables.

Query builder in Obseria with chart, run query and the generated SQL
Saved views overview with pages, time ranges and creation date
Export view in Obseria with filters, formats, preview and download
Access
Read-only, only your organization's tables
Limits
One statement, 30 s per query, up to 5,000 rows
Output
Table, bar, line or number, CSV export
Reuse
Saved queries, save as table, dashboards, workflows
Product tour

How your team works with SQL editor

Views of the Data area itself will follow. Until then, these screenshots show related views of the Obseria platform: the query builder, saved views, export, dashboards and workflows.
01 / 05

A query builder with chart and generated SQL

The screenshot shows the query builder in Obseria. The SQL editor in Obseria Data works on your business tables in the same spirit: write SQL, run it and see the result as a table or chart.

  • Read-only, isolated per organization
  • Ctrl or Cmd + Enter runs
  • Bar, line or number
A query builder with chart and generated SQL
02 / 05

Saved views with pages, time ranges and creation date

The screenshot shows saved views in Obseria. Saved queries in Obseria Data follow the same idea: a name, a description and the SQL, ready for the editor and for dashboard tiles.

  • Name and description per query
  • Chart setting stored with it
  • Warning before deleting a query in use
Saved views with pages, time ranges and creation date
03 / 05

Filter, preview and download

The screenshot shows the export view in Obseria. In the SQL editor, a result is exported as CSV with one click, or saved as a table of its own.

  • CSV for Excel
  • Save as table
  • Replaced on each save
Filter, preview and download
04 / 05

Dashboards with live panels and auto-refresh

The screenshot shows observability dashboards in Obseria. Business dashboards in Obseria Data build their tiles from your tables, from a visual builder or from a saved query.

  • Start a tile from a saved query
  • Number, bar, line or table
  • Open a tile's SQL in the editor
Learn more
Dashboards with live panels and auto-refresh
05 / 05

Workflows with schedule, last run and status

The screenshot shows a workflow list in Obseria. A workflow step runs read-only SQL on your tables and passes the rows on, for example to a CSV file and an email.

  • SQL step in workflows
  • Models rebuild tables on a schedule
  • Schedules in UTC
Learn more
Workflows with schedule, last run and status
Capabilities

SQL that ends up in reports, not in a drawer

Editor, saved queries, questions in plain language and dashboards work on the same tables, so every figure can be traced back to its query.
SQL editor

SQL editor

Read-only SQL across all tables of your organization, with a table and column browser, saved queries, bar, line or number charts, CSV export and save as table.

Data tables

Typed tables for business data from files, syncs, workflows or saved queries, with labels, personal-data flags, owner and retention per table.

Learn more →
  • Ask in plain language
  • Dashboards
  • Workflows and API
How it works

From an open question to a reusable query

Five steps of a typical session in the SQL editor, for example for a monthly revenue report.
    • invoices · 12,480 rows
    • customers · 1,930 rows
    • orders · 48,210 rows
    01

    Pick tables

    Open the table browser, see row counts and columns with their types, and click a name to insert it into the query.

  1. Example · Ctrl + Enter
    02

    Write the query

    Write a SELECT with filters, joins and grouping. Ctrl or Cmd + Enter runs it.

  2. Bar chart · revenue per customer
    03

    Check the result

    See rows, column types, row count and duration. Switch to a bar chart, a line chart or a single number.

  3. SQL
    Revenue per customer, this monthSaved query
    Saved
    04

    Save it

    Give the query a name and a description, or save the result as a table of its own.

    • CSV export
    • Save as table
    • Dashboard tile
    05

    Share and reuse

    Export as CSV, use the saved query in a dashboard tile or run the SQL on a schedule in a workflow.

In depth

How SQL editor works

Editor

Tables and columns next to the editor

The left side of the SQL editor lists every table of your organization with its row count. A click on a table inserts its name at the cursor, ready to query. Expanding a table shows its columns with their types, such as text, number, date or yes/no, and a click inserts the column name.

The editor keeps your last query when you come back, runs with Ctrl or Cmd + Enter and copies the SQL with one click. From a table page you can jump into the editor with a starter query that shows the latest rows of that table.

Need a question answered without writing SQL? The editor links to the plain-language Ask view, and every answer there can be opened back in the editor.

  • Table browser with row counts
  • Columns with types, click to insert
  • Ctrl or Cmd + Enter runs the query
  • Starter query from any table
Guard rails

Read-only and isolated per organization

Queries run under a read-only database user that only sees the tables of your organization. Only read statements are accepted: SELECT, WITH, SHOW, DESCRIBE and EXPLAIN, one statement per run. System tables and the tables of other organizations are not reachable.

Each query has a time limit of 30 seconds. The editor returns up to 5,000 rows and marks a result as truncated when there would be more. For larger results, save them as a table or aggregate first.

The SQL dialect is ClickHouse SQL. Tables that are updated by key keep older row versions until they are merged; append FINAL after a table name to read only the latest version of each row.

  • Only read statements, one per run
  • No system tables, no other organizations
  • 30 s per query, up to 5,000 rows
  • FINAL for the latest row versions
Results

From a result table to a chart in one step

Every result shows the row count, the duration in milliseconds and the type of each column. Numeric columns are right-aligned so amounts are easy to compare.

When the result has a numeric column, switch the view to a bar chart or a line chart; a result with a single row can be shown as one large number. The editor suggests the axes: a text or date column on the x axis and the first numeric column as the value.

The chart setting is stored with a saved query, so a dashboard tile built from it starts with the same chart.

  • Row count, duration and column types
  • Bar chart, line chart or single number
  • Axes suggested from the result
  • Chart stored with the saved query
Reuse

Saved queries, CSV export and save as table

A saved query has a name and a description and appears in the list next to the editor. It can be the source of a dashboard tile, and the editor warns before you delete a query that dashboards depend on.

CSV export downloads the current result with a semicolon separator and UTF-8 encoding, which opens cleanly in Excel. Save as table turns the result into a table of its own, replaced each time you save again. That is useful for derived lists that reports, dashboards and workflows read.

For results that should be rebuilt on a schedule, models run a query every 15 minutes up to monthly and write the result into a table, and workflows can run SQL and pass the rows to the next steps.

  • Saved queries with name and description
  • CSV export for Excel
  • Save as table, replaced on each save
  • Scheduled via models and workflows
Integrations

Query data from the systems you already use

Tables come from file imports, scheduled syncs, workflows and the API, including SQL syncs from PostgreSQL and MySQL and ready-made packages for business systems.
  • PostgreSQL
  • MySQL
  • GitHub
  • Jira
Guide

SQL editor explained: queries and reports on business data

What a SQL editor for business data is

A SQL editor is the place where you write a query, run it and look at the result. In a business data platform, it sits on top of the tables that hold your invoices, orders, customers and tickets. Instead of exporting three spreadsheets and matching them by hand, you write a few lines of SQL and get the answer, the same way every time.

A good online SQL editor for business data does more than run statements. It shows which tables and columns exist, keeps useful queries under a name, turns a result into a chart and lets the result leave the editor as a file, a table or a dashboard tile.

SQL query examples for invoices, orders and customers

Most reporting questions follow a handful of patterns. Revenue per customer this month:

SELECT customer, round(sum(amount), 2) AS revenue
FROM `invoices` FINAL
WHERE paid_at >= toStartOfMonth(now())
GROUP BY customer
ORDER BY revenue DESC
LIMIT 20

Orders per month, ready for a line chart:

SELECT toStartOfMonth(created_at) AS month, count() AS orders
FROM `orders` FINAL
GROUP BY month
ORDER BY month

Open invoices that are older than 30 days:

SELECT invoice_number, customer, amount, issued_at
FROM `invoices` FINAL
WHERE status = 'open' AND issued_at < now() - INTERVAL 30 DAY
ORDER BY issued_at

The patterns are always the same: filter with WHERE, group with GROUP BY, aggregate with sum, count or avg, and sort the result. Joins connect tables, for example invoices with the customer table, so a report can show the customer's region next to the revenue.

Read-only SQL: why analysis should never change data

Analysis and data changes should be separate. A report that accidentally runs an UPDATE or DELETE can destroy the numbers everybody relies on. That is why a read-only SQL setup is the right default for a reporting editor: only SELECT statements (and read statements such as WITH, SHOW, DESCRIBE and EXPLAIN) are allowed, one statement per run.

Two more guard rails matter in a shared platform. Queries should only see the tables of your own organization, and they should not reach system tables. And they need a time limit, so a runaway query does not block everyone else.

Joins, GROUP BY and date functions: practical tips

  • Group by time with date functions. Functions such as toStartOfMonth, toStartOfWeek or toDate turn a timestamp into a period, which is what most charts need.
  • Round money at the end. Sum raw amounts and round the result, not each row.
  • Always use a LIMIT while exploring. Look at 100 rows first, then remove the limit when you know the query is right.
  • Know how updates are stored. When rows are updated by key, an analytical store may keep older versions until it merges them. Reading with FINAL returns only the latest version of each row.
  • Name your columns. AS revenue makes the chart axis and the CSV header readable.

From query to report: saved queries, charts, CSV export and tables

A query that answers a recurring question deserves a name and a short description of what it answers and which assumptions it makes. Saved queries become the shared definition of a figure: when the sales team and the finance team open the same saved query, they see the same revenue.

From there, a result usually goes one of four ways. As a chart (bar, line or a single number) for a quick look. As a CSV export for a colleague who works in Excel. As a new table that other reports and workflows build on, for example a cleaned customer list. Or as a dashboard tile that refreshes on its own.

What matters is that the way back from a result to its query stays short. Anyone who sees a figure in a tile or an exported file should be able to find the query behind it with one click and check which filters and assumptions apply.

SQL editor, query builder or plain-language questions?

Not every question needs hand-written SQL. A visual builder with table, value, grouping and filters covers many dashboard tiles. A question in plain language that an AI model turns into SQL is the fastest start for people who do not write SQL. The SQL editor is the tool for everything else: joins across several tables, subqueries, careful date logic and checking exactly what an AI-generated query does.

In Obseria there is a second query tool that is easy to confuse with this one. The query language and query builder of the observability platform works on telemetry: logs, metrics, traces, web events and PromQL. The SQL editor described here works on business tables in Obseria Data.

Common mistakes in SQL reporting

  • Counting duplicates. A join that matches several rows per invoice multiplies the revenue. Check the row count before and after the join.
  • Mixing time zones. Decide which time zone a report uses and stick to it.
  • Unnamed one-off queries. If a number is reported twice, save the query that produced it.
  • Copying results by hand. Export the result or store it as a table instead of pasting values into a slide.

How the Obseria Data SQL editor supports this

  • Table browser: all tables of your organization with row counts; a click inserts the table name, expanding a table shows its columns and types.
  • Editor: runs with Ctrl or Cmd + Enter, keeps your last query, copies the SQL with one click and can be opened from any table with a starter query.
  • Guard rails: read-only statements only, one statement per run, no system tables, only your organization's tables, a 30-second limit per query and up to 5,000 rows per result.
  • Results: row count, duration and column types, shown as table, bar chart, line chart or single number.
  • Reuse: saved queries with name and description, CSV export, save as table, and use in dashboards, workflows and scheduled models.

Queries, saved queries and dashboards are included in Obseria Data. Only rows written, for example by saving a result as a table, and the data you keep are metered; see the pricing.

FAQ

Questions about SQL editor

Answers on features, setup and what is not included yet.
Contact us

SQL editor FAQ

ClickHouse SQL. Common functions such as sum, count(), round, toStartOfMonth and joins work as expected. Append FINAL after a table name to read only the latest version of rows that were updated by key.

No. Only read statements are accepted (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN), one per run, and they run under a read-only user that only sees your organization's tables. Data changes happen through imports, syncs, workflows, the API or editing in the table view.

The editor shows up to 5,000 rows and marks larger results as truncated. Each query may run for up to 30 seconds. For bigger datasets, aggregate in SQL or save the result as a table.

The query language and query builder work on telemetry in Obseria's observability platform: logs, metrics, traces, web events and PromQL. The SQL editor works on business tables in Obseria Data, such as invoices, orders and customers.

Not from the editor itself. Use a model to rebuild a table from a query every 15 minutes up to monthly, or a workflow with a SQL step, for example to mail the result as CSV every weekday morning.

Queries, saved queries and dashboards are included in Obseria Data. Rows written, for example when you save a result as a table, are billed at $0.50 per million after 1 million rows per month, and storage at $0.50 per GB-month after 1 GB. See pricing.

Contact

See SQL editor in action

In 30 minutes we show you how Obseria works in your environment and answer your questions on setup, privacy and pricing.

  • No obligation, free of charge
  • Usually answered within one business day
  • Data in the EU
Your contact
Your contactObseria team

* Required field. By submitting, you agree to the processing of your details as described in our Privacy Notice