Free PDF · Updated for v1.5

The DuckDB SQL Cheatsheet

A complete DuckDB syntax reference - every query pattern, function, and SQL feature from v1.0 to v1.5.

A printable DuckDB cheatsheet for developers who already know SQL and want to move fast. Covers DuckDB query syntax, file I/O, complex types, window functions, joins, and CLI commands in a copy-paste-ready format. Download the free PDF, bookmark the HTML version, or feed the plain text file to your LLM.

What's in the DuckDB Cheatsheet

Two pages covering the DuckDB SQL features that matter most in practice.

DuckDB SQL Essentials

FROM-first queries, SELECT modifiers like EXCLUDE and REPLACE, reading Parquet and CSV files, complex types (lists, structs, maps, unions), lambda functions, window functions with QUALIFY, ASOF joins, lateral joins, recursive CTEs, and installing extensions.

What's New in DuckDB v1.0 through v1.5

A version-by-version changelog covering two years of DuckDB releases. Includes MERGE INTO, the VARIANT type, GEOMETRY support, time travel queries, TRY expressions, community extensions, and more.

DuckDB CLI Tips and Commands

Output modes, dot commands, inline bar charts with bar(), progress bars, and custom syntax highlighting. Everything you need to be productive in the DuckDB command line.

DuckDB SQL examples

DuckDB-specific patterns you'll actually use. This is a fraction of what the cheatsheet covers.

duckdb-cheatsheet.sql
-- No SELECT needed
FROM 's3://bucket/data/*.parquet';

-- Drop columns you don't want
SELECT * EXCLUDE (internal_id, debug_col)
FROM users;

-- Lambda over a list column
SELECT list_transform(scores, lambda x: x * 2)
FROM students;

-- Match trades to nearest prior quote
SELECT * FROM trades
ASOF JOIN quotes
  ON trades.ticker = quotes.ticker
  AND trades.ts >= quotes.ts;

-- First row per group, one line
SELECT * FROM t
QUALIFY row_number() OVER (
  PARTITION BY group_col
  ORDER BY score DESC) = 1;

Download the DuckDB Cheatsheet

Free PDF. Print it, bookmark it, or feed it to your LLM.

Get the DuckDB Cheatsheet

Congrats! Redirecting youOne sec