Calculate the cumulative sum of a column using DuckDB

Duckdb, the (tabular) data exploration tool I use supports window operations. I recently discovered that it can also perform cumulative sums in a very efficient manner. Let us generate a toy dataset where we want to calculate the sum of one column relative to the order of another one. -- seeding for reproducibility, creating a table to hide output CREATE OR REPLACE TABLE seed AS SELECT SETSEED( 0…