Live data from Hacker News

Getting AI to write good SQL

cloud.google.com

341–350 of 379 posts

Re: Getting AI to write good SQL

#341

Earlier quoted context omitted.

I'm not an LLM proselytiser but this makes no sense? It would almost make sense if someone were claiming there are only two possible games, the old one and the new one, and never any more. Who claims that?

I suppose my point is along these lines. When gpt3 was trained, its parent company refused to release the weights claiming it was a “clear and present danger to civilization”. Now GPT3 is considered a discardable toy. So either these things are going toward an inflection point of usefulness or this release too will be, in time, mocked as a discardable toy too. So why every 3 days do we get massive threads with people…

Well essentially then, I agree, I find it perplexing too.

I got particularly burned by that press release a little before Christmas, where it was claimed that 4o was doing difficult maths and programming stuff. A friend told me about it very excitedly, I imagined they were talking about something that had really happened.

A few days later when I'd time to look into it, it turned out that essentially we'd internal testing and press releases to go off, I couldn't believe it. I said - so, marketing. A few months later it was revealed that a lot of the claimed results in those world-changing benchmarks were due to answers that had been leaked, etc etc. The usual hype theatre, in the end

Re: Getting AI to write good SQL

#342

Earlier quoted context omitted.

Mother of God. I can write JSON instead of a language designed for querying. What is the advantage? If I’m going to move up an abstraction layer, why not give me natural language? Lots of things turn a limited natural language grammar into SQL for you. What is JSON going to {do: for: {me}}?

Sorry, I couldn't parse that. You didn't quote your keys

Was on a phone. Also, there’s more invalid than that. Plus I am lazy.

Re: Getting AI to write good SQL

#343
post #315

Earlier quoted context omitted.

So glad we're pinning the success and learning of new technology on random anecdotes. Do pro AI people not see how untenable it is where everything is a rumor?

It is only a rumor to people who refuse to put in effort.

What does this even mean? Lol.

Re: Getting AI to write good SQL

#344

Earlier quoted context omitted.

It is only a rumor to people who refuse to put in effort.

I'd rather put my effort into developing my own skills, not hand-holding a hallucinating robot.

I enjoyed the clarity of that sentence. It's wild to read. Some people are choosing the hand-holding of the hallucinating robot instead of developing their skills, and simultaneously training their replacement (or so the bosses hope, anyway).

I wonder if "robot" was being used here in its original sense too of a "forced worker" rather than the more modern sense of "mechanical person". If not, I propose it.

Re: Getting AI to write good SQL

#345
post #241

Can 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…

I guess it depends on the type of tasks you give it. They all seem to work remarkably well writing typescript or python but in my experience, they fall short when it comes to shell and more broadly dev ops

[deleted]

Re: Getting AI to write good SQL

#346
post #167

Earlier quoted context omitted.

The current method of solving this is providing the AI with the documentation of the SDKs your code uses. Current LLMs have quite big context windows so you can feed them a lot of documentation. Some tools can even crawl multipage documentation and index them for the use of LLMs.

How do you do that practically/reliably? Would be great to just paste a link to the SDK Github repo, but doesn't seem to work (yet) in my experience

You can do this with Cursor. If your docs are at example.com, simply type "@example.com" and it will go read that webpage.

I've even had luck simply dropping an entire OpenAPI spec into my repo and adding the file to the context window (also using the @ command).

Re: Getting AI to write good SQL

#347

I understand from a technical POV how this could be considered great news. But I don't see how this is good news at all from a societal POV. The last 15 or so years has seen an unprecedented rise in salaries for engineers, especially software engineers. This has brought an interest in the profession from people who would normally not have considered SW as a profession. I think this is both good and bad. It has brough…

I understand how, from a technical POV, electricity and electrification could be considered great news. But I don't see how this is good news at all from a societal POV. Think about all the lamplighters who lost their jobs. Streetlights just turn on now? Lamplighting used to be considered a stable job! And what about the ice cutters… For real tho, it's not like there's nothing left to do — we still have potholes to f…

> we still have potholes to fix, t-shirts to fold and illnesses to cure

Only one of these things interests me. The hype of AI is threatening to kill something I actually enjoy doing. If the hype actualises, I'll likely find myself having to do something I don't enjoy. That being said, if programming can be automated, then probably every white collar job is under serious threat.

Re: Getting AI to write good SQL

#348

Earlier quoted context omitted.

It is absolutely the greatest golden age in programming ever - all these infinitely wealthy companies spending bajillions competing on who can make the best programming companion. Apart from the apologising. It's silly when the AI apologises with ever more sincere apologies. There should be no apologies from AIs.

I wish my AI would tell me when I'm going in the wrong direction, instead of just placating my stupid request over and over until I realize.. even though it probably could have suggested a smarter direction, but instead just told me "Great idea! "

One trick I found is to tell the llm that an llm wrote the code, whether it did or not. The machine doesn't want to hurt your feelings, but loves to tear apart code it thinks it might've wrote.

Re: Getting AI to write good SQL

#349

Can 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…

There's a complex Numpy indexing codes riddle in the section of "I don’t like NumPy indexing" and Gemini Pro 2.5 came on top (DeepSeek R1, only get the first time right but not later) [1],[2].

> For fun, I tried asking a bunch of AI models to figure out what shapes those arrays have. Here were the results:

Based on the results from the top 8 state-of-the- art AI models, Gemini is the best and consistently got the right results:

[1] I don't like NumPy (204 comments):

https://news.ycombinator.com/item?id=43996431

[2] I don't like NumPy: I don’t like NumPy indexing:

https://dynomight.net/numpy/

Re: Getting AI to write good SQL

#350

Earlier quoted context omitted.

I wish my AI would tell me when I'm going in the wrong direction, instead of just placating my stupid request over and over until I realize.. even though it probably could have suggested a smarter direction, but instead just told me "Great idea! "

One trick I found is to tell the llm that an llm wrote the code, whether it did or not. The machine doesn't want to hurt your feelings, but loves to tear apart code it thinks it might've wrote.

I like just responding with "are you sure?" continuously. at some point you'll find it gets stuck in a local minima/maxima, and start oscillating. Then I backtrack and look at where it wound up before that. Then I take that solution and go to a fresh session.
Post reply on HN