IntermediateAction GuideData Engineering

Run Ad-Hoc SQL Queries on CSV Files Without Database Setup

When stakeholders ask 'how many California orders used a discount code?', the traditional workflow requires spinning up PostgreSQL, writing CREATE TABLE DDL, configuring COPY commands, and running pg_dump just to execute a simple SELECT. This 45-minute friction discourages exploratory analysis. DuckDB-Wasm registers your CSV as a virtual table in the browser, running entirely in a WebAssembly sandbox. Write standard SQL—SELECT, WHERE, JOIN, window functions (ROW_NUMBER, LAG, SUM OVER), CTEs—and get results in milliseconds. Schema inference handles type detection automatically. Browser Wasm modules use memory-mapped virtual files backed by IndexedDB, allowing datasets larger than available RAM.

DataPrep Engineering TeamPublished: 2025-04-08Last verified: 2026-07-153 min read

Why This Matters

A growth analyst needed to validate UTM attribution across 2.3 million Shopify orders before a board meeting. Installing Postgres on a locked-down corporate laptop required a 3-day IT ticket. Excel Power Pivot crashed at the 1M row limit. Using this tool, they ran SELECT utm_campaign, SUM(revenue) FROM orders GROUP BY 1 in 1.8 seconds. No installation, no IT tickets, no Python environments. Just drag, drop, and query. The result changed the board narrative: two 'underperforming' campaigns were actually victims of attribution fragmentation.

Why Excel & Python Fail Here

The 45-minute setup tax kills exploratory analysis. For a one-off question, you shouldn't need: Docker install → Postgres container → createdb → CREATE TABLE → COPY FROM → query → DROP TABLE → container cleanup. Each step is a context switch that breaks analytical flow. Corporate laptops often block Docker and Homebrew. IT tickets take days. The answer should take seconds, not infrastructure provisioning.

CriterionExcel / SheetsPython / CloudDataPrep (This Page)
Max Rows ~150K (crashes) RAM-limited 1M+ via Wasm
Setup Time Manual formulas 30–60 min env setup 0 seconds
Data Privacy Local but fragile Uploads to cloud 100% in-browser
Cost License fees EC2 / SaaS $49+/mo Free forever

Step-by-Step Solution

We will use the SQL on CSV to execute this entirely in your browser.

  1. 1

    Drag and drop your CSV file(s)

    Upload one or more CSV files. Each is registered as a virtual table named after the file (e.g., 'orders.csv' → table 'orders'). Schema inference detects types: INTEGER, DOUBLE, VARCHAR, DATE, BOOLEAN.

  2. 2

    Write and execute SQL

    The SQL editor provides syntax highlighting, table/column autocomplete, and query history. Supports full DuckDB SQL: SELECT, JOIN, GROUP BY, HAVING, window functions, CTEs, UNNEST, and subqueries.

  3. 3

    Export results or continue iterating

    Results display in a sortable table. Export as CSV or copy to clipboard. Modify and re-run queries iteratively—the file stays loaded until you close the tab.

Privacy Guarantee: Zero Bytes Uploaded

All processing happens in your browser via WebAssembly. Your data never touches a server. Try it: disconnect your Wi-Fi right now—the tool will still work.

Works fully offline · No cookies · No tracking pixels

Common Errors & Fixes

Error / SymptomRoot CauseFix
Query returns 0 rows on a JOINType mismatch: one CSV has 'customer_id' as VARCHAR ('00123'), the other as INTEGER (123)Use explicit CAST: SELECT * FROM a JOIN b ON CAST(a.customer_id AS VARCHAR) = CAST(b.customer_id AS VARCHAR)
Browser tab crashes on 5GB+ fileExceeding 4GB Wasm linear memory limitSplit the file first using our CSV Splitter, or filter columns to reduce memory footprint

Frequently Asked Questions

Is my data uploaded to any server?
No. DuckDB-Wasm runs entirely in your browser's WebAssembly sandbox. The file is read via the File System Access API and never leaves your machine. Disconnect WiFi to verify.
What SQL dialect is supported?
DuckDB SQL, which is PostgreSQL-compatible with extensions. Supports: QUALIFY, UNNEST, LIST/STRUCT types, read_csv_auto(), PIVOT, and 200+ functions. Not supported: PL/pgSQL stored procedures.

Ready to clean your data?

100% local processing · Zero uploads · Blazing fast

Trusted by 2,400+ data teams · 18M+ rows processed monthly

DP

DataPrep Engineering Team

We build privacy-first data preparation tools that run entirely in your browser. Every workflow on this page has been tested against production datasets exceeding 500K rows. We verify each guide against real platform exports quarterly.

Last reviewed by the engineering team on 2026-07-15.