Is My SQL Query Going To Break Production?

A senior data engineer identifies SQL query pitfalls that can trigger nasty errors — and even break your data pipelines.

Zach Quinn
Learning SQL

--

When I was learning how to drive a two-prop boat, the captains assigned to train me all had their unique ways of irritating me. But, incidentally enough, it was the calmest one that got me into the most trouble. Where the others would bark commands or rip the wheel (sorry there’s no fancy nautical term for “wheel”) out of my trembling hands, this guy would wait for it… do nothing.

And, inevitably, we’d either miss or slam into a dock.

Looking back, it was impressive how, barely looking up from his phone he could tell a maneuver wouldn’t work before it was even executed.

Years later, as a more experienced developer, I’ve had similar interactions with peers and juniors. I truly believe that one isn’t anointed experienced or “senior” until they’re able to see errors before they happen.

While I’ve had more of these interactions while reviewing or developing Python scripts, with many processes and user-facing products relying on SQL views, I’d argue that it’s just as valuable, if not more so, to be able to anticipate errors in your SQL scripts.

To prevent (or at least reduce) future “fire drills”, I want to highlight a few of my go-to strategies to answer the age-old question:

--

--

Zach Quinn
Learning SQL

Journalist—>Sr. Data Engineer; helping you target, land and excel in data-driven roles.