4 Advanced aggregation and analysis of data

This chapter covers

  • Preparing, cleaning and aggregating data while ingesting
  • Using window functions to create new aggregates over different partitions of any dataset
  • Understanding the different types of subqueries
  • Using common table expressions
  • Applying filters to any aggregate

The goal of this chapter is to give you some ideas on how an analytical database, such as DuckDB, can be used to provide reports that would take a considerably larger amount of code written in an imperative programming language. While we will build upon the foundation laid in chapter 3, we will leave a simple SELECT xzy FROM abc behind quickly. Investing your time in learning modern SQL won’t be wasted. The constructs ...

Get DuckDB in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.