Live data from Hacker News

Getting AI to write good SQL

cloud.google.com

361–370 of 379 posts

Re: Getting AI to write good SQL

#361

Earlier quoted context omitted.

I’ve yet to see any llm proselytizers acknowledge this glaring fact: Each new release is “game changing”. The implication being the last release y’all said was “game changing” is now “from a different century”. Do you see it? For this to be an accurate and true assessment means you were wrong both before and wrong now.

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?

People are definitely being hyperbolic.

If we were actually getting revolutionary, game changing, improvements to productivity every couple of months. The whole industry would be in such chaos that people would be pausing investments until the chaos stopped.

Re: Getting AI to write good SQL

#362
post #350

Earlier quoted context omitted.

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.

Isn’t this sort of what the reasoning models are doing?

Re: Getting AI to write good SQL

#363
post #264

Earlier quoted context omitted.

Try OpenRouter. Load up with $20 of credits and use their API for a variety of models across providers, including Gemini. I think you pay ~5% extra for the OpenRouter service.

Do you work for OpenRouter?

Why ask that? OpenRouter is very popular.

Re: Getting AI to write good SQL

#365

Earlier quoted context omitted.

I contest that. A human using an LLM to program, is a human programming. Gaining skill with the LLM is gaining skill in programming. And the things most people are both able and willing to now create with LLMs are of vastly greater complexity than whatever they were doing before - so yes, it's advanced programming. I also contest your definition of wealth. Society absolutely and obviously becomes wealthier when many…

I'm happy to accept your contest, but you should be aware that both of our opinions are only beliefs at this point and science will have an answer at some point in the future when the effects of LLMs on humans are understood better. I do have to ask though, who do you think will pay the electricity bill for disenfranchised groups lacking wealth the most strongly to use LLMs? Some things might be free right now, but w…

Electricity in the US currently hovers around 20 cents per kWh; 1 kWh gets you somewhere on the order of 1000 ChatGPT queries. So that's about 0.02 cents per query.

At the current US federal minimum wage of $7.25, that means you would need to work for about 0.1 seconds to afford the electricity bill for one query. Maybe 1 full second for one of the really hard ones.

So my serious answer to your question is, I'm pretty sure these disenfranchised groups can find room in their budget for a query or two if they think it's worth doing. In fact, they might even find ways to save more than 1 second by using that query, in which case they can produce more economic value... And so society gets richer.

Re: Getting AI to write good SQL

#367

Earlier quoted context omitted.

I'm happy to accept your contest, but you should be aware that both of our opinions are only beliefs at this point and science will have an answer at some point in the future when the effects of LLMs on humans are understood better. I do have to ask though, who do you think will pay the electricity bill for disenfranchised groups lacking wealth the most strongly to use LLMs? Some things might be free right now, but w…

Electricity in the US currently hovers around 20 cents per kWh; 1 kWh gets you somewhere on the order of 1000 ChatGPT queries. So that's about 0.02 cents per query. At the current US federal minimum wage of $7.25, that means you would need to work for about 0.1 seconds to afford the electricity bill for one query. Maybe 1 full second for one of the really hard ones. So my serious answer to your question is, I'm prett…

I apologize for being excessively metaphorical and using "the electricity bill" to refer to the overall cost of using AI.

That said, it should be clear to you that any future pricing of AI services after the currently ongoing honeymoon period will need to recover the initial investments that have happened in the past years, pay for silicon, and make some profit too.

Re: Getting AI to write good SQL

#368

Earlier quoted context omitted.

Most people here have not understood the relational model, so yes.

I’ve read most of Codd’s book on the subject and have written SQL on and off since the mid 90’s and I still need to look up the differences between the various joins anytime I use them.

Ok, but you did get the general concept of why it is better than a hierarchical file storage system.

I also assume you dont try to throw mongoDB on every problem where a SQL database is clearly superior.

Re: Getting AI to write good SQL

#369

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.

You're absolutely right! My mistake. I'll be careful about apologizing too much in the future.

Does the barber shave himself?

Re: Getting AI to write good SQL

#370
post #362
post #350

Earlier quoted context omitted.

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.

Isn’t this sort of what the reasoning models are doing?

Except they have no concept of what "right" is, whereas I do. Once it seems to gotten itself stuck in left field I go back a few iterations and see where it was.
Post reply on HN