DuckDB is a high-performance analytical database system with a rich SQL dialect that supports far beyond basic SQL. DuckDB provides a SQL dialect with support for arbitrary and nested correlated subqueries, window functions, collations, complex types (arrays, structs, maps), and several extensions designed to make SQL easier to use.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/duckdb/duckdb/llms.txt
Use this file to discover all available pages before exploring further.
Standard SQL Compliance
DuckDB provides a SQL dialect that is closely aligned with the SQL standard, specifically PostgreSQL compatibility. The database engine is designed to be fast, reliable, portable, and easy to use.Core Features
- ANSI SQL Support: Full support for standard SQL statements including SELECT, INSERT, UPDATE, DELETE
- Transactions: ACID-compliant transactions with BEGIN, COMMIT, and ROLLBACK
- Data Types: Rich set of data types including integers, decimals, strings, dates, timestamps, and more
- Complex Types: Native support for arrays, structs (records), maps, and nested combinations
- NULL Handling: Proper three-valued logic with NULL support
Friendly SQL Extensions
DuckDB extends standard SQL with several convenient features to make SQL easier to write and more expressive:SELECT * EXCLUDE/REPLACE
Modify SELECT * to exclude or replace specific columns:GROUP BY ALL
Automatically group by all non-aggregate columns:Direct File Querying
Query CSV, Parquet, and JSON files directly without loading:Column Aliases in WHERE/GROUP BY
Use column aliases defined in SELECT within WHERE and GROUP BY:UNION BY NAME
Union tables by column names instead of position:Query Features
Correlated Subqueries
DuckDB supports arbitrary and nested correlated subqueries:Column Name Qualification
Explicit table qualification for clarity:Data Types
DuckDB supports a comprehensive set of data types:- Numeric: INTEGER, BIGINT, SMALLINT, TINYINT, DECIMAL, DOUBLE, FLOAT
- Text: VARCHAR, TEXT
- Temporal: DATE, TIME, TIMESTAMP, INTERVAL
- Binary: BLOB, BITSTRING
- Boolean: BOOLEAN
- Complex: ARRAY, STRUCT, MAP, UNION
- Special: UUID, JSON
DuckDB automatically infers types from CSV and Parquet files, making data import seamless.
Performance Optimizations
DuckDB’s SQL engine includes several performance optimizations:- Vectorized Execution: Processes data in vectorized batches
- Parallel Query Execution: Automatically parallelizes queries
- Optimized Join Algorithms: Hash joins, merge joins, and nested loop joins
- Filter Pushdown: Pushes filters close to data sources
- Column Pruning: Only reads necessary columns from files
Example: Complete Query
Next Steps
- Learn about Data Import methods
- Explore Query Syntax in detail
- Discover Built-in Functions
- Master Window Functions
- Understand Join Operations