Module 17
SQL cleaning
A declared dialect, CTEs, CASE, trimming, typed casts, window functions and validation queries.
Validate before you cast in SQL
Check text against an explicit pattern before casting in DuckDB, and build a first-failing-reason column with one ordered CASE. · 10 min
One reason column for clean and exceptions
Compute a single reason column in rule order and split clean rows from exceptions with it. · 10 min
TRY_CAST for quarantine
Convert text to types in SQL without failing the query, and quarantine values that don't convert. · 7 min
Profiling queries in SQL
Write a few reusable queries that profile any column in DuckDB. · 7 min
Module 17 quiz
Practice questions: choose an answer and check it to see the explanation. Nothing here is timed or graded.