←back to thread

Getting AI to write good SQL

(cloud.google.com)
477 points richards | 1 comments | | HN request time: 0.214s | source
Show context
deadbabe ◴[] No.44011205[source]
All this LLM written SQL stuff sounds great until you realize if you don’t really know SQL you won’t be able to debug or fix any broken SQL an LLM generates.

Thus, this is mainly just a tool for true experts to do less work and still get paid the same, not a tool for beginners to rise to the level of experts.

replies(3): >>44011369 #>>44011436 #>>44012630 #
roywiggins ◴[] No.44011369[source]
It depends, sometimes just feeding back broken SQL with "that didn't return any rows, can you fix it" and it comes up with something that works. Or "you're looking at the wrong entity, look at this table instead" or whatever, without knowing how to write competent SQL.

Obviously being able to at least read a bit of SQL and understanding the basic idea of relational databases helps loads.

replies(1): >>44015121 #
sgarland ◴[] No.44015121[source]
> It depends, sometimes just feeding back broken SQL with "that didn't return any rows, can you fix it" and it comes up with something that works.

But how do you know if the SQL is correct, or just happened to return results that match for one particular case?

replies(1): >>44015129 #
bdangubic ◴[] No.44015129[source]
how do you know SQL is correct if you write it yourself or another teamate of yours?
replies(1): >>44015235 #
sgarland ◴[] No.44015235[source]
Because I know the language...?
replies(1): >>44015778 #
1. bdangubic ◴[] No.44015778[source]
if you know the language verify the llm output :)