Sourcetable includes a built-in SQL editor that lets you query both spreadsheet data and connected databases using standard SQL syntax. It runs on DuckDB, which means fast, in-browser SQL execution.Documentation Index
Fetch the complete documentation index at: https://sourcetable.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Opening the SQL editor
Access the SQL editor from the sidebar or toolbar. You can also ask the AI: “Open the SQL editor.”Querying spreadsheet data
Your sheet names act as table names, and column headers act as column names:Cross-sheet queries
Query across multiple sheets in the same workbook:Querying connected databases
When you have database connectors configured, select the data source from the dropdown at the top of the SQL editor, then write your query. Sourcetable runs the query on the remote database and returns results to your spreadsheet.Supported SQL features
| Feature | Supported | Examples |
|---|---|---|
| SELECT / FROM / WHERE | Yes | Basic queries with filtering |
| GROUP BY / HAVING | Yes | Aggregations with conditions |
| ORDER BY / LIMIT | Yes | Sorting and pagination |
| JOIN | Yes | INNER, LEFT, RIGHT, FULL, CROSS joins |
| Subqueries | Yes | Nested SELECT statements |
| CTEs | Yes | WITH clauses for readable queries |
| Window functions | Yes | ROW_NUMBER(), RANK(), LAG(), LEAD(), SUM() OVER() |
| UNION / INTERSECT / EXCEPT | Yes | Combining result sets |
| CASE expressions | Yes | Conditional logic |
| Aggregate functions | Yes | SUM, AVG, COUNT, MIN, MAX, STDDEV, PERCENTILE_CONT |
| String functions | Yes | CONCAT, SUBSTRING, REPLACE, REGEXP_MATCHES |
| Date functions | Yes | DATE_TRUNC, DATE_DIFF, CURRENT_DATE |
| Type casting | Yes | CAST(), ::type syntax |
Visual query builder
The query builder lets you construct queries without writing SQL:Add conditions
Build WHERE clauses with visual filter controls — select a column, operator (equals, contains, greater than, etc.), and value.
Configure joins
If querying multiple tables, define join conditions with visual dropdown selectors for left table, right table, and join columns.
Data library
Save frequently used queries for reuse:- Write and test your query
- Click Save to Library
- Name and categorize the query
- Access it later from the data library in the sidebar
AI-powered queries
Instead of writing SQL manually, ask the AI in natural language:- “Show me the top 10 products by revenue this quarter”
- “How many new customers signed up each month?”
- “What’s the average order value by customer segment?”