Show HN: Translate English to SQL
github.com
github.com
I remember briefly working with it and realizing, “No, this is never going to work because users have a tough time spelling things accurately.”
However, it immediately reminds me of the main drawback of SQL: it was designed with the aim that it would be easy for non-programmers to use, at a point in history when that seemed to make sense to the designers. Hence SQL itself has a natural languagey feel, e.g. a keyword like "group by" has an embedded space despite "group" and "by" having no meaning individually. As many others have observed less superficially, SQL lacks composability. It feels less like a programming language and more like a natural language interface to a relational database. It's certainly great, and has proven the test of time, etc etc, but I agree that we can do better, e.g. the following article's discussion, if not their proposed solution.
How does it handle real life tables such as "employee_stock_option_pool_not_vested_IDS" for example?
FROM ubuntu:18.04
It'd be interesting to see what the space savings to Alpine would be.i wanted to check with dive [1] but sadly couldn't pull the linked image. the mentioned name on the github readme doesnt seem to exist
Also CoreNLP
Same thing with visual "no code" programming. Is that really simpler to endlessly move around colorful blocks than writing a few lines in, say, Python?
(I'm with you, I hate natural language interfaces too, but there we are.)
Sure, I should do it the "go fast by going slow" way and spend time to read the manual and go through the tutorial. But often I'll want to know something which many people will have asked.
Looking at the queries I write as a product manager, I wouldn't have the slightest clue how to translate them to English. How do you LEFT JOIN on a relation and fetch NTiles on a calculated value from three different tables? Surely this will require some English-to-schema dictionary that someone who knows SQL will have to maintain.
"How many bridges are there that are in the same state as any bridge designed by O.H. Amman and are shorter than the number of kilometers between the Earth and the Moon divided by the number of people living in the state and have a maximum load that is at least as great as the combined weight of all currently living Asian elephants?"
When someone walks over and asks, "What does this query do?" Do you just tell them that it cannot possibly be put into English? Of course not, knowing the answer and knowing how to say the answer in at least one human language are the same thing.
Those are two different strings in SQL and shouldn't match exactly.
This already shows one difficulty of translating a natural language to a SQL query.
https://kendsnyder.com/utf8_bin-vs-utf8_general_ci/
utf8_bin: compare strings by the binary value of each character in the string
utf8_general_ci: compare strings using general language rules and using case-insensitive comparisons
utf8_general_cs: compare strings using general language rules and using case-sensitive comparisons
What's the longest bridge in mariland - or was it merryland (or maybe state_code=MD), is it in bridges table or bridge, or maybe bridge_specs joined on bridges by some id...I'll just write my sql in my favorite sql autocomplete tool.
SELECT MAX(length) FROM bridges WHERE state = 'merryland'
And they could recognize the error of merryland vs. MD.[1] https://www.aclweb.org/anthology/P18-1034 [2] https://arxiv.org/pdf/1709.00103.pdf