SQL Editor
The SQL editor lets you write your own query to explore datasets.
Zuletzt aktualisiert
War das hilfreich?
The SQL editor lets you write your own query to explore datasets.
Zuletzt aktualisiert
War das hilfreich?
It’s useful if you want more control than the visual builder offers. You can select columns, add filters, and group or sort results exactly how you want. The editor uses .
To run a query, you must first select a dataset and always end your query with a LIMIT
. The maximum row number for queries is 1000.
You can switch to SQL mode from any insight:
Go to the Data tab.
Click the SQL button next to No-code.
This opens a text editor where you can write your SQL query.
You always need to define which dataset the query should run on.
Click the dropdown labeled Available datasets.
Copy the dataset ID using the Copy button.
Paste it into your SQL code.
Example:
Important: Always add LIMIT
at the end of your query. The query won’t run without it. 1000 is the maximum number of rows for the query.
Once the dataset is selected, you can write any valid DuckDB SQL.
This example counts how many rows exist for each department and sorts them from high to low.
Below the editor, you’ll see a list of columns for the selected dataset. Each one shows:
The column name
The data type (like VARCHAR
, DATE
, DOUBLE
, etc.)
Use these to help write valid queries without guessing column names.
Example types:
Name
VARCHAR
Text values
Start date
DATE
Date for filtering
Age
BIGINT
Whole number
Full-time equivalent
DOUBLE
Decimal number
You can use all standard DuckDB clauses. Here’s a quick overview:
select
Pick which columns to show
from
Define the dataset
where
Filter rows (e.g. where age > 30
)
group by
Summarize data (e.g. totals per category)
order by
Sort rows (e.g. order by name asc
)
limit
Always required, limits number of rows
All SQL queries are validated before they are run. The system checks your query to make sure it is safe and follows platform rules.
Operations that could change, delete, or harm data — like DROP
, DELETE
, UPDATE
, or creating new tables — are not allowed. If the system detects something invalid or unsafe, the query won’t run.
This ensures that only safe and read-only operations are possible in the editor.
Click the Run button to execute your query. Results appear in the table on the left.
If nothing shows up:
Check for typos in column names.
Make sure the dataset ID is correct.
Confirm you added limit 1000
.
If still empty, your query might return no rows based on the filters.
Want to use the builder again?
Click No-code next to SQL.
This resets your query and returns to the drag-and-drop interface.
Note: You will lose your current SQL query if you switch.