5 ms·
If you know SQL why is this better than just writing SQL? If you don’t know SQL how do you know it’s correct? I had to forbid my coworkers from using chatgpt
by jmuguy 3y ago
If you know SQL why is this better than just writing SQL? If you don’t know SQL how do you know it’s correct?
I had to forbid my coworkers from using chatgpt to generate SQL because it kept doing things slightly wrong - like missing parens when dealing with AND and OR in a where statement.
- getmeinrn 3y agoYou send the produced query through a parser and a validator. The parser ensures it is syntactically correct, the validator ensures it is only accessing allowed data.
- jmuguy 3y agoThe SQL it produced for my coworkers ran without error - it just produced undesired results.
- getmeinrn 3y agoIt sounds like your concern is that an LLM is not capable of understanding an english explanation of the query and producing the correct query. I personally have not had many issues here, and the time saved by tweaking a generated query is larger than writing the query myself from scratch. And LLMs will only improve so that these tweaks require less time.
- bugglebeetle 3y agoWriting tweaks to complex statements is tedious and I’m lazy? I often just feed in existing queries and scripts and say “use the below as a template, but do X,Y, and Z instead.” GPT-4 does this correctly the majority of the time and for all but a handful of circumstances, can typically be coaxed into the correct thing with a couple of back-and-forths.
- _ea1k 3y agoI feel the same way when someone gives me an MR without suitable unit tests. How do they know it is correct?
- DonaldPShimoda 3y ago> If you know SQL why is this better than just writing SQL? If you don’t know SQL how do you know it’s correct? This line of reasoning applies for all areas of knowledge, and I wish more people would realize this about LLMs.
- welfare 3y agoI know (some) French, still use ChatGPT or Google Translate a lot to get me started if I want to send a note to someone in French. I still do some hand-waving afterwards to ensure it's correct but that's about it. I'd argue that this process applies to any GPT-type generator, it serves a starting point so you're not staring at a blank piece of paper, but it won't give you the final result.
- jmuguy 3y agoThe benefit of using GPT to produce something for another human is the other human can understand you even if the statement is slightly weird or incorrectly worded. SQL doesn’t have the same tolerance.
- wodenokoto 3y agoMost people can read more complicated text than they can write. Most people who need to generate a query can run it and look at the results. I use chatgpt to help me, particularly with languages I don’t write in everyday. And I often find myself arguing with chatgpt that what it wrote is wrong, because I can read the query, but don’t know how to write the query I need.
- nonethewiser 3y agoI agree with your sentiment but it actually occurred to me that code might actually be the reverse - where you can write more complicated code than you can read.
- lanstin 3y agoA nice corollary to Kernighan's law on debugging. I guess it can go either way. Sometimes ChatGPT4 is great and saves me time, but the cycle of "explain what I want, get the output test/compile it, post the errors, try again" doesn't always converge quickly enough to not be more irritating than actually learning the issues in the code I'm trying to interface with. So I'll try it a bit, but if it goes back and forth more than 3 or 4 times, I'll give up and dig in to study the thing.
- nonethewiser 3y ago> If you know SQL why is this better than just writing SQL? If you don’t know SQL how do you know it’s correct? You test it. And what do you mean by “know SQL?” No one knows everything about SQL. Virtually everyone writing SQL is in between the two extreme cases you provide.
- jmuguy 3y agoIf you understand SQL enough to know if the query ChatGPT produced is valid - you probably could have written it yourself. I don’t see how prompting chatgpt and testing its results is faster or better than just writing SQL.
- nonethewiser 3y ago> If you understand SQL enough to know if the query ChatGPT produced is valid Like I said, you need to test it. Not read it. Test it.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- Mustachio 3y agoImo it depends on what you're prompting. If you yourself do not fully understand what you want and/or which information you have to provide for the model to 'understand' enough context, prompts will not give good results. I usually find ChatGPT very good for converting conceptual ideas to a concrete piece of 'boilerplate' to work off of. It can help you jump gaps in your proces, but in the end you still have to make the jumps yourself.
- d0mine 3y agoI can recognize much more faces than I can describe/draw. It is easier to read foreign language than to write it (active vs passive vocabulary). It is the same with googling, looking for a solution on StackOverflow: understanding/judging whether the solution is good may be faster than constructing it yourself.