In-process analytical SQL · Parquet / CSV / Arrow / Pandas / Polars · verified against DuckDB 1.x (2026)

DuckDB cheat sheet

DuckDB is an in-process analytical (OLAP) SQL engine — think "SQLite for analytics". No server: pip install duckdb and query Parquet/CSV/JSON files, Pandas/Polars DataFrames and Arrow tables in place, with a vectorized columnar engine that often beats Pandas on larger-than-memory data. It reads & writes the formats you already use and exposes both plain SQL and a Pythonic relational API. This sheet targets DuckDB 1.x.

connect & query read files DataFrame interop relational API analytics & extensions gotcha most common

Verified 2026-08-24 against the official docs at duckdb.org/docs (Python client + SQL reference, 1.x). Zero-dependency, embeddable; the same SQL runs in the CLI, Python, R, Java, Rust, WASM and Node.

Outline

The magic: point SQL directly at files or DataFrames — no load step. Pick SQL or the relational API; they interconvert freely.

Basics

  1. 1 · Install, connect, query
  2. 2 · Get results out

Read data

  1. 3 · Parquet / CSV / JSON
  2. 4 · Remote (S3 / HTTP)
  3. 5 · Pandas / Polars / Arrow

Query

  1. 6 · Relational API
  2. 7 · Friendly SQL
  3. 8 · Lists, structs, JSON

Persist & scale

  1. 9 · Write & persist
  2. 10 · Extensions & perf
  3. 11 · Gotchas
  4. Worth memorizing

Basics

One import, and you're querying.

1Install, connect, query1.x
2Get results outto Python

Read Data

Query files directly by name — DuckDB reads only the columns/rows it needs.

3Parquet / CSV / JSONno load step
4Remote (S3 / HTTP)httpfs
5Pandas / Polars / Arrowquery DataFrames

Query

Compose with the relational API, or lean on DuckDB's "friendly SQL" extensions.

6Relational APIPythonic, lazy
7Friendly SQLDuckDB extras
8Lists, structs, JSONnested data

Persist & Scale

Write results out, add capabilities, and tune.

9Write & persistexport
10Extensions & performancesuperpowers

Gotchas

Small surprises when coming from Pandas or a client/server DB.

!Common gotchasread before shipping

Worth memorizing

SQLite for analyticsin-process, columnar, vectorized; pip install and go
query files directlyFROM 'data.parquet' — no CREATE TABLE, with predicate/projection pushdown
DataFrames by namereplacement scan: SELECT * FROM df with zero copy
.df() / .pl() / .arrow()results back to Pandas / Polars / Arrow with no serialization
relational API is lazy.filter().aggregate()...; runs on fetch, composes with SQL
friendly SQLFROM-first, SELECT * EXCLUDE/REPLACE, GROUP BY ALL, QUALIFY, SUMMARIZE
httpfs = query S3/HTTP in placerange-reads remote Parquet; CREATE SECRET for creds
COPY (...) TO 'out.parquet'the export workhorse, incl. PARTITION_BY
in-memory by defaultconnect("file.duckdb") to persist; one writer per file