The Hockey Brain
Data Stack6 min read

Getting started with DuckDB for hockey data

Why a single-file analytical database is the fastest way to start your hockey data stack.

Raw files

CSV / JSON / Parquet

  • Scraped events
  • Downloads
Query in place

DuckDB

  • read_csv / read_json
  • SQL over files
Model

Views & tables

  • silver views
  • gold marts
Use

Notebook / BI / AI

  • pandas
  • Claude
DuckDB queries raw files directly, then materializes your modeled tables.

The 30-second version

  • DuckDB is a fast, zero-setup analytical database that runs inside your notebook.
  • It queries CSV/JSON/Parquet directly — no server, no ingestion ceremony.
  • Perfect for the bronze → silver → gold pattern before you ever touch the cloud.

Why DuckDB first

Most people think building a data stack means standing up a warehouse and a pile of infrastructure. DuckDB flips that: it is a single-file analytical database that runs in-process, so you can query gigabytes of hockey data straight from your laptop or notebook with plain SQL — no server to run, no accounts to create.

Query files without importing them

DuckDB reads CSV, JSON and Parquet directly. You can point a `SELECT` at a scraped play-by-play file and start exploring immediately, then wrap the good queries as views. That means your "ingestion" step is often just organizing files, and your modeling is just SQL.

Grow into the same pattern

The bronze → silver → gold layering you would use in a cloud warehouse works identically in DuckDB: raw files are bronze, cleaning views are silver, and materialized analysis tables are gold. When you outgrow the laptop, MotherDuck runs the same DuckDB SQL in the cloud — so nothing you learn here is wasted.

Build it yourself

  1. 1Install once: `pip install duckdb` (or use the CLI).
  2. 2Query a file directly: `SELECT * FROM read_csv('shots.csv') LIMIT 5;`
  3. 3Create a silver view that cleans and types the raw events.
  4. 4Materialize a gold table (e.g. shots with an xG estimate) with CREATE TABLE AS.
  5. 5Read it into pandas or hand it to an AI tool.

Key terms

Newsletter

Weekly hockey analytics

Data-driven takes on performance, scouting, and team strategy. No fluff — just the numbers that matter.

No spam. Unsubscribe anytime.

Related explainers