Hacker News new | ask | show | jobs
by aldarisbm 872 days ago
looks great, most text-to-sql attempts i’ve tried fall short, hoping this is different
1 comments

I do this a lot with GPT4 and I can't recall it ever generating an invalid query, and I did have some complicated ones.
The problem isn't the SQL generation per se, it's the mapping between natural language and the data that columns actually hold. If you have a clean schema with well named fields, LLMs are very good at generating valid SQL but if you have an old schema that has been patched and modified for years by a dozen DBAs each with their own naming quirks, short hands, and hacks, it can barely string a valid query together.
Yeah, blame the user for for poorly named columns and whatever "clean" means, that's it. That's what's blocking the feature.

The issue is that SQL is not composable. It's necessary to articulate the messy operation all at once and it's not possible to iterate on it.

Good luck!