There is a spectrum from "AI writes everything and runs it" to "humans write everything by hand." Almost every team I see picks one of the two endpoints. Both are wrong for SQL.
The right point is in the middle. The AI drafts the query. A human reads it before it runs. That sounds obvious until you watch how few tools actually default to it.
The case for fully automatic SQL generation is "it's faster." That's true and not enough.
Two things go wrong without a review step.
First, the AI silently picks the wrong join semantics and you don't catch it. Claude can correctly write a LEFT JOIN orders 95% of the time. The 5% it writes INNER JOIN orders you lose every customer who hasn't placed an order yet. The query runs. The number is wrong. Nobody knows because it's a number, not an exception.
Second, write operations get scary. You said "delete that test user." The agent runs DELETE FROM users WHERE email = '[email protected]'. It also runs it without a LIMIT 1, and it turns out three test users had that email across three environments because of an old data import you forgot about. The "test user" you wanted to delete is gone. The other two are also gone, and one of them was a real customer who happened to use that email five years ago.
This isn't theoretical. I've watched it happen in slack threads. The agent did exactly what was asked. The ask was wrong. There was no chance to catch it.
Read-only enforcement at the gateway prevents the second problem. You still need a review step for the first.
Writing a 25-line query with three CTEs and a window function to answer "which customers placed orders over $100 last month grouped by signup cohort" is a 12-minute job for a senior. Most companies don't have a senior available for those 12 minutes.
So either:
All three of these happen every week at every series-A startup I've talked to. The cost of "fully manual" isn't that SQL is hard. It's that asking the question becomes a political event, and most questions just don't get asked.
The model I think makes sense, and the one QueryBear runs:
There are three reasons this is the right shape.
It's faster than manual. The 12-minute query becomes a 30-second one. Even if the user spends another 30 seconds reading the SQL, you're 10x ahead.
It's safer than fully automatic. The user has a real chance to notice "wait, that's an inner join, not a left." That's the moment that prevents the wrong number.
It's accessible. People who can read SQL but not write it can still verify a query. That's a much larger group than people who can write it from scratch. A PM, a designer, an ops lead, a customer-success manager — most of them can read SELECT email, count(*) FROM orders WHERE created_at > '2026-04-01' GROUP BY email. Almost none of them want to type it.
I get pushback from skeptical engineers that AI-assisted SQL "just makes people lazy" and they should learn SQL. I have some sympathy. I also think the empirical floor of useful SQL knowledge has gone down a lot.
The skill you need to use AI-assisted SQL well isn't writing — it's reading. Specifically:
INNER JOIN, LEFT JOIN, and the silent assumption an INNER JOIN makes.GROUP BY clause it should have.WHERE filter on a destructive query that the AI happens to have written as a SELECT (in your tool, anyway — never trust this in raw psql).NULL = NULL is NULL, not true, and what that does to your filter.That's a few hours of reading, not a CS degree. Most people who get burned by AI SQL got burned because they skipped this — not because the AI was bad.
The teams getting real value from AI-assisted SQL share a few traits:
The teams that get burned skip the review and assume the AI is a black box that produces correct numbers. It isn't. It's a typing assistant with a lot of context. Treat it like one.
The reason I'm building QueryBear is that the gap between "fully automatic, fast, sometimes wrong" and "fully manual, slow, gated by engineering" is where most real teams want to live. They just don't have a tool that lets them.
That's the pitch. Use AI to write the SQL. Use your eyes to make sure it's right. Use a gateway to make sure that even if you're wrong, the worst case is a confusing number, not a deleted table.