Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

DuckDB Cheat Sheet

DuckDB Cheat Sheet

Back to Databases
Updated 2026-03-19
Next Topic: Elasticsearch Cheat Sheet

DuckDB is an in-process columnar SQL analytics database designed for fast analytical queries on local data without server overhead. Unlike traditional databases, DuckDB executes directly within your application (like SQLite but optimized for OLAP workloads), making it ideal for data science workflows, ETL pipelines, and interactive analytics on laptops or in production. A key differentiator is zero-copy integration with Parquet, CSV, Arrow, and Pandas—DuckDB can query files and data structures directly without importing them first, enabling sub-second analytics on GB-scale datasets using familiar SQL. The latest version (1.5.0) introduces the VARIANT type for semi-structured data and moves GEOMETRY to core, reflecting DuckDB's expanding role beyond traditional analytics into geospatial, JSON-heavy, and streaming workflows.


What This Cheat Sheet Covers

This topic spans 23 focused tables and 189 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Core SQL OperationsData TypesFile Format ReadingData IntegrationJoin TypesAggregation & Window FunctionsAdvanced SQL FeaturesExtensionsMacros & UDFsWindow Functions & AnalyticsList & Array OperationsStruct & Map OperationsJSON OperationsPerformance & OptimizationMotherDuck & CloudConfiguration & PragmasData Export & WritingTransactions & ConstraintsPrepared Statements & ParametersCLI & Interactive FeaturesMetadata & IntrospectionString & Date FunctionsPython API

Core SQL Operations

ConceptExampleDescription
SELECT Statement
SELECT name, age
FROM users;
• Retrieves specified columns
• DuckDB supports projection pushdown for Parquet/CSV.
FROM-First Syntax
FROM users
SELECT name
"Friendly SQL" allows omitting SELECT clause or reversing clause order.
WHERE Clause
WHERE age >= 18
AND status = 'active'
• Filters rows before aggregation
• supports predicate pushdown to file formats.
GROUP BY
GROUP BY country,
ROLLUP(year)
• Aggregates rows by key
• supports ROLLUP, CUBE, GROUPING SETS, ALL.
HAVING Clause
HAVING COUNT(*) > 10
• Filters aggregated results after GROUP BY
• operates on aggregate functions.
ORDER BY
ORDER BY ALL DESC
• Sorts results
• ORDER BY ALL sorts by all columns, uses BINARY collation default.
LIMIT / OFFSET
LIMIT 100 OFFSET 50
• Paginates results
• large offsets can be slow, prefer keyset pagination for performance.

More in Databases

  • Database Transactions and Concurrency Control Cheat Sheet
  • Elasticsearch Cheat Sheet
  • Amazon DynamoDB Cheat Sheet
  • Database Design Cheat Sheet
  • MariaDB Cheat Sheet
  • PostgreSQL Cheat Sheet
View all 42 topics in Databases