Did you do better and you have tips?
NOTE: I'm not talking about performant queries only about producing a correct result. I would say that only about 50% cannot be better optimized, but I don't care about that.
We built a basic Re-Act agent that can dynamically inspect the database context and generate the queries iteratively.
Our experience was that it was hard to do single-shot.
Happy to answer any questions.
[1] https://github.com/inferablehq/inferable/tree/main/adapters/...