←back to thread

Getting AI to write good SQL

(cloud.google.com)
478 points richards | 4 comments | | HN request time: 0.629s | source
Show context
rectang ◴[] No.44010899[source]
> We will cover state-of-the-art [...] how we approach techniques that allows the system to offer virtually certified correct answers.

I don't need AI to generate perfect SQL, because I am never going to trust the output enough to copy/paste it — the risk of subtle semantic errors is too high, even if the code validates.

Instead, I find it helpful for AI to suggest approaches — after which I will manually craft the SQL, starting from scratch.

replies(4): >>44011204 #>>44011349 #>>44011379 #>>44011432 #
1. paulddraper ◴[] No.44011432[source]
Hopefully your trust in yourself is warranted
replies(2): >>44011729 #>>44012314 #
2. rectang ◴[] No.44011729[source]
I embrace my fallibility, and enthusiastically pursue testing, code reviews, staging environments, and so on to minimize the mistakes that make it through to production.

It seems to me that this skeptical mindset is consonant with handling AI output with care.

3. auggierose ◴[] No.44012314[source]
You'd rather trust in AI than yourself?
replies(1): >>44012366 #
4. malthaus ◴[] No.44012366[source]
in writing good sql code? i definitely would

ai is not going to replace the senior sql expert with 20 years of battle experience in the short-term but support me who last dug into sql 15 years ago and needs to get a working sql query in a project. and ai usually does a better job than me copy pasting googled code in between quickly browsing through tutorials.