Module 02
SQL for ML Engineers
Use SQL to create reliable datasets, features, labels, and diagnostics for machine learning workflows.
7 lessons · 8 videos · 1h 39m- 02.01
SQL for Training Datasets
Write SQL queries that assemble feature columns, labels, entity identifiers, and event timestamps into a training dataset.
- 02.02
CTEs for Readable Transformations
Refactor a nested SQL query into named CTEs that separate filtering, joins, aggregations, and final feature selection.
- 02.03
Window Functions for Features
Use window functions to compute rolling counts, lag features, rank features, and time-bounded aggregates for ML examples.
- 02.04
Point-in-Time Correct Joins
Implement an as-of join that prevents future data leakage when joining historical features to labels.
- 02.05
Query Plans and Optimization
Read a query execution plan and improve a slow query by reducing scanned data, optimizing joins, and using partition filters.
- 02.06
dbt Models for ML Transformations
Create dbt models that materialize staging, intermediate, and feature tables with tests and documentation.
- 02.07
SQL Testing and Assertions
Write SQL-based assertions that validate uniqueness, null rates, accepted values, freshness, and label distribution constraints.