liveBook · Manning

What you will learn in DuckDB in Action

by Mark Needham, Michael Hunger, Michael Simons

Chapter by chapter

Chapter 1: An introduction to DuckDB

1.1 What is DuckDB? · 1.2 Why should you care about DuckDB? · 1.3 When should you use DuckDB? · 1.4 When should you not use DuckDB? · 1.5 Use cases · 1.6 Where does DuckDB fit in? · 1.7 Steps of the data processing flow · 1.7.1 Data formats and sources · 1.7.2 Data structures · 1.7.3 Developing the SQL · 1.7.4 Using or processing the results · 1.8 Summary

What you learn in chapter 1 →

Chapter 2: Getting started with DuckDB

2.1 Supported environments · 2.2 Installing the DuckDB CLI · 2.2.1 macOS · 2.2.2 Linux and Windows · 2.3 Using the DuckDB CLI · 2.3.1 SQL statements · 2.3.2 Dot commands · 2.3.3 CLI arguments · 2.4 DuckDB’s extension system · 2.5 Analyzing a CSV file with the DuckDB CLI · 2.5.1 Result modes · 2.6 Summary

What you learn in chapter 2 →

Chapter 3: Executing SQL queries

3.1 A quick SQL recap · 3.2 Analyzing energy production · 3.2.1 Downloading the dataset · 3.2.2 The target schema · 3.3 Data definition language queries · 3.3.1 The CREATE TABLE statement · 3.3.2 The ALTER TABLE statement · 3.3.3 The CREATE VIEW statement · 3.3.4 The DESCRIBE statement · 3.4 Data manipulation language queries · 3.4.1 The INSERT statement · 3.4.2 Merging data · 3.4.3 The DELETE statement · 3.4.4 The SELECT statement · 3.5 DuckDB-specific SQL extensions · 3.5.1 Dealing with SELECT · 3.5.2 Inserting by name · 3.5.3 Accessing aliases everywhere · 3.5.4 Grouping and ordering by all relevant columns · 3.5.5 Sampling data · 3.5.6 Functions with optional parameters · 3.6 Summary

What you learn in chapter 3 →

Chapter 4: Advanced aggregation and analysis of data

4.1 Pre-aggregating data while ingesting · 4.2 Summarizing data · 4.3 On subqueries · 4.3.1 Subqueries as expressions · 4.4 Grouping sets · 4.5 Window functions · 4.5.1 Defining partitions · 4.5.2 Framing · 4.5.3 Named windows · 4.5.4 Accessing preceding or following rows in a partition · 4.6 Conditions and filtering outside the WHERE clause · 4.6.1 Using the HAVING clause · 4.6.2 Using the QUALIFY clause · 4.6.3 Using the FILTER clause · 4.7 The PIVOT statement · 4.8 Using the ASOF JOIN · 4.9 Using table functions · 4.10 Using LATERAL joins · 4.11 Summary

What you learn in chapter 4 →

Chapter 5: Exploring data without persistence

5.1 Why use a database without persisting any data? · 5.2 Inferring file type and schema · 5.2.1 A note on CSV parsing · 5.3 Shredding nested JSON · 5.4 Translating CSV to Parquet · 5.5 Analyzing and querying Parquet files · 5.6 Querying SQLite and other databases · 5.7 Working with Excel files · 5.8 Summary

What you learn in chapter 5 →

Chapter 6: Integrating with the Python ecosystem

6.1 Getting started · 6.1.1 Installing the Python package · 6.1.2 Opening up a database connection · 6.2 Using the relational API · 6.2.1 Ingesting CSV data with the Python API · 6.2.2 Composing queries · 6.2.3 SQL querying · 6.3 Querying pandas DataFrames · 6.4 User-defined functions · 6.5 Interoperability with Apache Arrow and Polars · 6.6 Summary

What you learn in chapter 6 →

Chapter 7: DuckDB in the cloud with MotherDuck

7.1 Introduction to MotherDuck · 7.1.1 How it works · 7.1.2 Why use MotherDuck? · 7.2 Getting started with MotherDuck · 7.2.1 Using MotherDuck through the UI · 7.2.2 Connecting to MotherDuck with DuckDB via token-based authentication · 7.3 Making the best possible use of MotherDuck · 7.3.1 Uploading databases to MotherDuck · 7.3.2 Creating databases in MotherDuck · 7.3.3 Sharing databases · 7.3.4 Managing S3 secrets and loading Data from S3 buckets · 7.3.5 Optimizing data ingestion and MotherDuck usage · 7.3.6 Querying your data with AI · 7.3.7 Integrations · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: Building data pipelines with DuckDB

8.1 Data pipelines and the role of DuckDB · 8.2 Data ingestion with dlt · 8.2.1 Installing a supported source · 8.2.2 Building a pipeline · 8.2.3 Exploring pipeline metadata · 8.3 Data transformation and modeling with dbt · 8.3.1 Setting up a dbt project · 8.3.2 Defining sources · 8.3.3 Describing transformations with models · 8.3.4 Testing transformations and pipelines · 8.3.5 Transforming all CSV files · 8.4 Orchestrating data pipelines with Dagster · 8.4.1 Defining assets · 8.4.2 Running pipelines · 8.4.3 Managing dependencies in a pipeline · 8.4.4 Advanced computation in assets · 8.4.5 Uploading to MotherDuck · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Building and deploying data apps

9.1 Building a custom data app with Streamlit · 9.1.1 What is Streamlit? · 9.1.2 Building our app · 9.1.3 Using Streamlit components · 9.1.4 Visualizing data using plot.ly · 9.1.5 Deploying our app on the Community Cloud · 9.2 Building a BI dashboard with Apache Superset · 9.2.1 What is Apache Superset? · 9.2.2 Superset’s workflow · 9.2.3 Creating our first dashboard · 9.2.4 Creating a dataset from an SQL query · 9.2.5 Exporting and importing dashboards · 9.3 Summary

What you learn in chapter 9 →

Chapter 10: Performance considerations for large datasets

10.1 Loading and querying the full Stack Overflow database · 10.1.1 Data dump and extraction · 10.1.2 The data model · 10.1.3 Exploring the CSV file data · 10.1.4 Loading the data into DuckDB · 10.1.5 Fast exploratory queries on large tables · 10.1.6 Posting on weekdays · 10.1.7 Using enums for tags · 10.2 Query planning and execution · 10.2.1 Planner and optimizer · 10.2.2 Runtime and vectorization · 10.2.3 Visualizing query plans with Explain and Explain Analyze · 10.3 Exporting the Stack Overflow data to Parquet · 10.4 Exploring the New York Taxi dataset from Parquet files · 10.4.1 Configuring credentials for S3 access · 10.4.2 Auto-inferring file types · 10.4.3 Exploring Parquet schema · 10.4.4 Creating views · 10.4.5 Analyzing the data · 10.4.6 Making use of the taxi dataset · 10.5 Summary

What you learn in chapter 10 →

Chapter 11: Conclusion

11.1 What we have learned in this book · 11.2 Upcoming stable versions of DuckDB · 11.3 Aspects we did not cover · 11.4 Where can you learn more? · 11.5 What is the future of data engineering with DuckDB?

What you learn in chapter 11 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.