Answers5 min

Can I Run SQL on a CSV File Without a Database?

Yes — DuckDB-WASM runs the full DuckDB engine in your browser and queries CSV, Parquet, and JSON directly. Zero install, zero upload.

Zro7 SQL Playground uses DuckDB-WASM. Your CSV never leaves the browser tab — the whole query engine runs on the client.

Yes. You don't need Postgres, MySQL, or SQLite installed. DuckDB-WASM loads the full DuckDB analytics engine into your browser and queries CSV, Parquet, JSON, and Excel files directly — no import step, no server. Open Zro7 SQL Playground, drop a file, and run SELECTs immediately.

The one-liner that reads a CSV

DuckDB treats files as tables via table functions:

  • SELECT * FROM 'sales.csv' LIMIT 10;
  • SELECT country, SUM(amount) FROM 'sales.csv' GROUP BY 1 ORDER BY 2 DESC;
  • SELECT * FROM read_csv_auto('weird_delim.csv', delim='|');

Why this is a big deal

  • No schema declaration — DuckDB infers column types on read.
  • Multi-gigabyte CSVs work — DuckDB streams and uses memory efficiently.
  • Joins across files: FROM 'orders.csv' o JOIN 'customers.csv' c USING (id).
  • Reads Parquet and JSON with the same syntax.
  • Window functions, CTEs, PIVOT, and analytics — the full SQL:2016+ surface.

When DuckDB-WASM is the wrong tool

  1. You need concurrent writes from multiple users — use Postgres.
  2. You need to serve queries as an API — DuckDB is embedded, not a server.
  3. Persistent multi-session state — the browser tab is the lifetime.

Alternatives you might reach for

  • SQLite + CSV import: works, but you must CREATE TABLE and .import first.
  • Pandas / Polars: excellent for Python users; DuckDB is faster on group-by-heavy analytics.
  • Excel Power Query: fine up to ~1M rows; falls over past that.
  • q (cli): nice for terminals; DuckDB is a superset.

Try it in 30 seconds

  1. Open Zro7 SQL Playground.
  2. Drop your CSV (up to multi-GB — see Big CSV Viewer for really large ones).
  3. The file appears as a table named after its filename.
  4. Run any SELECT.
  5. Export results to CSV or JSON.

Updated December 30, 2026 · Zro7 editorial team.

Frequently asked questions

How big a CSV can I query?

Practically bound by browser memory (~2-4 GB per tab). Bigger files stream via Parquet.

Does it support JOINs across files?

Yes — you can join a CSV to a Parquet to a JSON in one query.

Can I write results back to CSV?

Yes: COPY (SELECT ...) TO 'out.csv' — Zro7 surfaces the download automatically.

Is DuckDB SQL the same as Postgres?

Very close — DuckDB borrows Postgres syntax and adds analytics extensions like PIVOT and QUALIFY.

Does it upload my data?

No. DuckDB-WASM is a single .wasm blob that runs in your tab; files stay client-side.

Related posts

← Back to blog