SmartQueryTools

SQL Query Tool

Load one or more files and query them with SQL. Each file becomes a table named after its filename. Everything runs in your browser — your data never leaves your device.

How to use the SQL Query Tool

  1. Click "+ Add File" and choose one or more files, or drag them onto the My Files panel. CSV, TSV, Parquet, JSON, NDJSON, Arrow, Excel (.xlsx or .xls, first sheet) and YAML are supported.
  2. Each file becomes a table named after its filename, so orders.csv becomes orders. Characters other than letters, digits and underscores become underscores. Click a table in the list to see its columns and types.
  3. Write a query in the SQL editor, or open the Builder to pick columns, filters, sort order and a row limit without typing.
  4. Click Run Query or press Ctrl+Enter (Cmd+Enter on a Mac). Results appear below the editor.
  5. Download the result as CSV or JSON. To work with public data instead of your own files, open the Data Catalog tab and load a dataset into the editor.

Worked example

You have two exports: a customer list and an order list. You want total spend per customer, largest first.

Input: customers.csv and orders.csv, then the query

customers.csv
customer_id,name,country
1,Ana,PT
2,Ben,NZ
3,Chloe,FR

orders.csv
order_id,customer_id,amount
101,1,40
102,3,25
103,1,15
104,2,60

SELECT c.name, COUNT(*) AS orders, SUM(o.amount) AS total
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
GROUP BY c.name
ORDER BY total DESC;

Result

name   orders  total
Ben    1       60
Ana    2       55
Chloe  1       25

The two files are joined on customer_id like two database tables. Ana has two orders (40 + 15 = 55), so she appears once with a count of 2. Ben has the single largest order and comes first.

Frequently Asked Questions

Is my data uploaded to a server?

No. The SQL engine is compiled to WebAssembly and runs inside your browser. Files you load are read locally, queries run on your device, and nothing is sent anywhere. Close the tab and the data is gone.

What SQL dialect does the editor use?

DuckDB SQL, which closely follows PostgreSQL syntax. It supports joins, window functions, CTEs, aggregation, string and date functions, and PIVOT and UNPIVOT. If you know PostgreSQL, most of your queries will work as written.

Can I query multiple files together?

Yes. Load as many files as you need and join them like database tables, even when they are different formats, for example a CSV of orders joined to a Parquet file of customers on a shared key column.

Can I query a file from a URL?

Yes. Pass an https URL to a read function, for example SELECT * FROM read_csv_auto('https://...'). The server hosting the file must allow cross-origin (CORS) requests from browsers. The Data Catalog tab lists public datasets that are known to work.

How large a file can I query?

Files up to 500 MB can be loaded. How fast queries run depends on your device and its memory. The engine is columnar, so aggregations over a few million rows usually finish in seconds on a typical laptop.

Related tools