Practical SQL and data analytics
Working notes on fraud detection, public-sector data, and analytics engineering — from inside a program-integrity team. Mostly SQL, with the usual cloud data warehouses and BI tools. Occasionally Python. Always grounded in the actual queries I run.
Recent writing
- What goes on a fraud team's dashboard, and what doesn't
Most fraud dashboards look better in a leadership deck than they work on an analyst's second monitor.
- Five things that actually reduce noisy fraud alerts (and three that don't)
The standard fix doesn't work. Here's what does, with the SQL.
- Detecting fraud rings: the social-graph problem in disguise
How to find connected fraud accounts using recursive CTEs and self-joins. Solves the graph-database problem without a graph database.
- Eight window-function tricks beyond LAG and ROW_NUMBER
QUALIFY, frame specs, FILTER, gap-and-island, and the rest of the window-function patterns that turn five-line fraud rules into one-line filters.
- Six SQL patterns I use to catch transaction fraud
The actual queries I run when I'm hunting fraud in transaction data. Velocity, impossible distances, suspicious amounts, merchant clusters, off-hours buys, and window functions.