The Wonders and Challenges of Using AI

What I learned from using AI to develop SQL queries and schemas for production systems — and why treating it like a powerful but unreliable assistant works better than trusting it blindly.

I have been using AI in my day-to-day work long enough now that it no longer feels like a novelty. It feels like a tool. A powerful one — but still a tool.

One of the first places it became genuinely useful for me was in helping develop and debug SQL queries and schemas for a Retool-based low-code application we were building for a real estate services company.

The system was not trivial.

It had:

This was not toy SQL. It was production logic.

And AI — specifically ChatGPT — was surprisingly good at it.

The good: speed, fluency, and breadth

What immediately stood out to me was how fluent it was with SQL.

Not just syntax — but structure, patterns, and even database-specific nuance.

It understood:

It could:

The speed was the most noticeable thing.

Things that would normally take me:

...could often be reduced to a short back-and-forth.

In terms of raw mechanical capability, it often felt on par with a strong senior engineer or DBA — especially for well-formed, localized problems.

That is genuinely impressive.

And it is genuinely useful.

The problem: hallucination and false confidence

Where things started to break down was exactly where I expected them to: complexity and uncertainty.

As the system grew more complex, and as the schema evolved, ChatGPT started to do something subtle but dangerous.

It began to confidently reference things that did not exist.

Not in a dramatic way.
In a very plausible way.

It would:

And it would not tell you it was guessing.

It would just proceed.

That is the core danger.

Not that it is wrong.
But that it is wrong in a way that looks right.

And when you are working in financial, operational, or production systems, looks right is not good enough.

How I learned to work with it

Over time, I stopped treating ChatGPT like an engineer and started treating it like a very powerful but unreliable assistant.

That changed how I used it.

I stopped asking:

Write this entire query.

And started asking:

I also got stricter about:

And I got very disciplined about verification.

I never trusted output blindly.
I always ran it.
I always tested it.
I always sanity-checked it against reality.

That is not because I distrust the tool.
It is because I respect the cost of being wrong.

Forcing decomposition and reconciliation

One pattern I noticed very quickly is that AI tends to try to solve the entire problem in one go.

It will happily generate a large, monolithic solution — a giant query, a complex pipeline, or an end-to-end flow — even when the problem is poorly understood or still evolving.

That is almost always the wrong move.

So I started forcing the opposite behavior.

Instead of letting it build the whole thing, I would direct it to:

For example, instead of building one big reporting query, I would have it:

  1. First define the correct base dataset
  2. Then validate row counts and filters
  3. Then validate aggregations in isolation
  4. Then reconcile results against existing reports
  5. Then check edge cases and anomalies

I would often ask it to help me manually reconcile different reports and data sources — not to trust one output, but to cross-check them against each other.

That process matters.

Because correctness in complex systems rarely comes from one clever solution.
It comes from convergence — when multiple independent views agree.

A pattern I now trust

The pattern that works for me looks like this:

  1. Define the problem clearly.
  2. Define the schema explicitly.
  3. Break the problem into small pieces.
  4. Ask the AI to reason, not just generate.
  5. Reconcile outputs against reality and against each other.
  6. Only then compose the full solution.

Used this way, it is incredibly valuable.

Used casually, it is dangerous.

Share this article
LinkedIn Facebook X