I suggested something similar in an internal chat, i.e. using AI as a tool to help specify, debug and improve your code, rather than delegating all coding to it, and I think the collective response was essentially 'ok grandpa'.
I think we have to expect the majority of SQL queries will soon be machine generated and machine tuned. The planner in database engines will use LLMs. There will be LLM chats to help you specify what query you want to make, and it will work out which tables etc via question and answer.
is that faster than just knowing what tables you want to run it on? I can see it for agentic but having to chat back and forth every time sounds frustratingly slow for my tastes
SQL is in a sweet spot of declarative, formal, and high level. It's basically a description of what the resulting dataset means, not just how to produce it. For ad-hoc queries maybe LLMs take over in the short term, and that's how I read your example. But for core, repeated business logic, human-written SQL seems to still hold value.