Earlier quoted context omitted.
> So now that we brought down prod for a day the new rule is no AI sql without three humans signing off on any queries.
If that’s the scenario, I would be asking why the testing pipeline didn’t catch this rather than why was the AI SQL wrong.
Getting AI to write good SQL
251–260 of 379 posts
Re: Getting AI to write good SQL
#252Can I just say that Google AI Studio with latest Gemini is stunningly, amazingly, game changingly impressive. It leaves Claude and ChatGPT's coding looking like they are from a different century. It's hard to believe these changes are coming in factors of weeks and months. Last month i could not believe how good Claude is. Today I'm not sure how I could continue programming without Google Gemini in my toolkit. Gemini…
Re: Getting AI to write good SQL
#253Earlier quoted context omitted.
Same reason as why it's harder to solve a sudoku than it is to verify its correctness.
I should have made my post clearer :) There isn't one perfect solution to SQL queries against complex systems. A suduko has one solution. A reasonably well-optimised SQL solution is what the good use of SQL tries to achieve. And it can be the difference between a total lock-up and a fast running of a script that keeps the rest of a complex system from falling over.
It's not even about whether or not the number of solutions is limited. A math problem can have unlimited amount of proofs (if we allow arbitrarily long proofs), but it's still easier to verify one than to come up with one.
Of course writing SQL isn't necessarily comparable to sudoku. But the difference, in the context of verifiability, is definitely not "SQL has no single solution."
Re: Getting AI to write good SQL
#254The article comments "out of the box, LLMs are particularly good at tasks like creative writing" but I think this actually demonstrates the problem with the ai. A writer won't think that they're good at creative writing. In fact, I'm pretty sure they'd think LLM's are terrible at creative writing. In other words, to an expert in their field, they're not that good - at least not yet. But to someone who is not an exper…
Yes, but why is then everyone on HN claiming LLMs can code on expert level?
Re: Getting AI to write good SQL
#255Can someone please answer these questions because I still think AI stinks of a false promise of determinable accuracy: Do you need an expert to verify if the answer from AI is correct? How is it time saved refining prompts instead of SQL? Is it typing time? How can you know the results are correct if you aren't able to do it yourself? Why should a junior (sorcerer's apprentice) be trusted in charge of using AI? No ma…
> Do you need an expert to verify if the answer from AI is correct?
If the underling data has a quality issue that is not obvious to a human, the AI will miss it too. Otherwise, the AI will correct it for you. But I would argue that it's highly probable that your expert would have missed it too... So, no, it's not a silver bullet yet, and the AI model often lacks enough context that humans have, and the capacity to take a step back.
> How is it time saved refining prompts instead of SQL?
I wouldn't call that "prompting". It's just a chat. I'm at least ~10x faster (for reasonable complex & interesting queries).
Re: Getting AI to write good SQL
#256Earlier quoted context omitted.
That doesn’t answer the question. By “validate”, I mean “prove to yourself that the regular expression is correct”. Much like with program code, you can’t do that by only testing it. You need to understand what the expression actually says.
Testing something is the best way to prove that it behaves correctly in all the cases you can think of. Relying on your own (fallible) understanding is dangerous. Of course, there may be cases you didn't think of where it behaves incorrectly. But if that's true, you're just as likely to forget those cases when studying the expression to see "what it actually says". If you have tests, fixing a broken case (once you di…
Re: Getting AI to write good SQL
#257LLMs make some things that were difficult very easy now.
Good article!
Re: Getting AI to write good SQL
#258Wait... people need AI to write SQL ?
Re: Getting AI to write good SQL
#259Earlier quoted context omitted.
This is the same fallacy as low-code/no-code. If you have to check a precise algorithm, you’re effectively coding, and you need a language with the same precision as a programming language.
Only if you want a production-ready output. To get execs able to self-feed enough, this works fine. Look, you don’t see value until it’s perfect. Good, other people do. I see your fallacy and raise you a false dichotomy.
Re: Getting AI to write good SQL
#260The article comments "out of the box, LLMs are particularly good at tasks like creative writing" but I think this actually demonstrates the problem with the ai. A writer won't think that they're good at creative writing. In fact, I'm pretty sure they'd think LLM's are terrible at creative writing. In other words, to an expert in their field, they're not that good - at least not yet. But to someone who is not an exper…
Yes, but why is then everyone on HN claiming LLMs can code on expert level?