Description:
Debugging SQL usually means guessing, running partial queries, and hoping your data makes sense.
This time, I let Claude Code lead the investigation.
In this video, I show a real-world debugging session from Atherio, where we recently finished a feature called DEE a data-heavy capability that relies on:
Large-scale data ingestion from Microsoft 365
Signal analysis powered by OpenAI
Historical backfills and rolling score calculations (last 30 days)
After onboarding a new customer, we needed high confidence that:
Historical imports were correct
DEE scores were calculated accurately
No subtle data inconsistencies were hiding beneath “working” results
Instead of manually writing dozens of SQL queries, I prompted Claude Code to help validate the data.
What happens next is where things get interesting:
Claude generates targeted SQL scripts to inspect the imported data
It spots questionable states in the dataset and proactively suggests deeper checks
It iteratively narrows down the investigation, just like a senior engineer would
In the end, it confirms the calculations are correct
Finally, it generates a single, reusable SQL validation script that:
Verifies the entire import
Recomputes expectations
Produces an initial validation report in one run
This isn’t a toy example or a contrived demo.
It’s how AI is starting to change how we reason about data, not just write code.
If you work with:
SQL-heavy systems
Data pipelines
AI-powered products
Or complex onboarding & backfills
…this workflow will likely change how you debug forever.
Share this link via
Or copy link























