Summary: SQL Runner is a scratchpad in Alta where you write raw SQL against your connected data, run it, and preview the results as a table or a chart — without building a saved widget first.
Who this is for
Anyone comfortable writing SQL who wants to check a number, sanity-check a model, or debug the query behind an existing chart. You don't need SQL for everyday reporting — the Data Explorer covers that with a point-and-click builder.
Before you start
You need at least one connected data source (Snowflake, BigQuery, Microsoft SQL Server, or Alta's own data). SQL Runner queries the same warehouse your dashboards read from.
SQL Runner is read-only in practice — it's built for
SELECTqueries and previewing results.
Open SQL Runner
In the left sidebar, expand Explore.
Click SQL Runner. (You can also go straight to
/explore/sql.)
The page has three parts: the SQL editor at the top, the results preview underneath, and a settings panel on the right.
Write and run a query
Click into the editor — it shows the placeholder Write a SQL query — and start typing.
Don't type table names directly. Instead, start typing a table name and pick it from autocomplete: Alta suggests every table it has indexed across your sources, grouped by schema, and inserts the reference in the template form it needs — a
schema.tablepair wrapped in a doubled pair of curly braces. Alta expands that into the fully qualified warehouse table when the query runs.Click Run in the top-right, or press Ctrl + Enter.
Results appear in the panel below. Before you run anything, that panel reads Execute query to see preview.
Drag the divider between the editor and the results to give either one more room, and use the panel button on the right of the toolbar to show or hide the settings panel.
Turn the results into a chart
By default results render as a Table. To change that, open the Visualization dropdown in the right-hand settings panel. SQL Runner supports seven types:
Table — always available
Line Chart and Area Chart
Bar Chart and Column Chart
Pie Chart
Single Value
Alta infers a type for every column in your result set and only enables the chart types that fit. The rules:
Line and Area need a date column plus a numeric column.
Bar and Column need any non-numeric grouping column plus a numeric column.
Pie needs a non-date grouping column plus a numeric column.
Single Value just needs one numeric column.
Open an existing chart's SQL
You don't always have to start from a blank editor. Anywhere Alta shows you generated SQL, you can send it straight to SQL Runner:
In the Data Explorer, switch the results panel to the SQL tab and click View in SQL Runner.
In a chat with Alta, use Open in SQL Runner on a query the assistant ran.
The query opens pre-filled and fully editable — handy for debugging why a widget returns the numbers it does, and the fastest way to see correctly formatted table references.
Tips and common pitfalls
Every query is capped at 500 rows. Alta appends
LIMIT 500automatically — and if your query already has aLIMITclause, Alta replaces it with 500. WritingLIMIT 5000will not get you 5,000 rows. Aggregate in SQL rather than trying to pull raw rows out.The date filter doesn't apply. The date picker in the toolbar is greyed out on purpose, with the tooltip "Time filter is not applied to raw SQL." Put your own date conditions in the
WHEREclause.Plain table names won't resolve. If a query fails with a "table not found" style error, you probably typed the bare table name instead of picking it from autocomplete. Delete it and re-insert it from the suggestion list.
Read the error, then the SQL. A failed run shows an Error running the query alert with your warehouse's message. Click Show SQL to see exactly what Alta sent after expanding your table references — that's usually where the problem is.
Columns named like IDs are treated as labels, not numbers. A column called
idor anything ending in_idis classified as a grouping column even though it holds numbers, so it won't satisfy a chart's numeric requirement. Alias it or wrap it in an aggregate if you want to chart it.Date detection is name- and value-based. Columns ending in
_date,_time,_day,_week,_month,_year,_at, or_ts— or holding ISO-formatted dates — become date columns. If a line chart stays greyed out, alias your date column to one of those endings.Your query isn't saved. SQL Runner is a scratchpad, not a saved asset. Copy anything you want to keep before you click Exit. To save and share a visualization, rebuild it in the Data Explorer.
