Live data from Hacker News

MQL – Client and server to query your db in natural language

github.com

21–30 of 33 posts

Re: MQL – Client and server to query your db in natural language

#22
post #3

My experience with this kind of tool is that it is at least as hard to learn the tool as it is to learn the technology it abstracts over. I think that's because thinking about the problem I am trying to solve is always the hardest part and I have to learn a syntax and semantics no matter what. And the syntax and semantics of SQL is mathematically linked to the mathematics of relational databases. Natural language isn…

Agreed. Dozens of companies have built and sold "business intelligence" tools and report builders and visual query interfaces, all promising to ease the interface between man and data and make information easily accessible.

And then every one of these tools turns out to only be usable (barely) by some "data analysts" and never by the executives to whom the system was originally sold.

Re: MQL – Client and server to query your db in natural language

#23

Genuine question: does anyone here actually want to query their database with natural language?

The people that hire data analysts do.

Is this to be trusted with things that have to be accurate such as a subpoena ?

Besides, I feel like a data analyst should be able to know what questions to ask, not just how to translate business requests to sql.

Re: MQL – Client and server to query your db in natural language

#24
post #12

text-to-sql is a dead end. There's no way for a model to correctly interpret the meaning of every column in a real world database using the `information_schema` alone. Most cloud warehouses (e.g. Snowflake) don't use foreign keys, so you don't even know the joins. Imagine you hire a highly skilled data analyst (e.g. 9 out of 10 proficiency in SQL) and start asking them questions about your database. They won't answer…

providing some context about the data, the schema + samples from the entries works quite well, definitely room for improvement but already quite usable imho

agree, with familiarity with SQL one can use it as a reference for generating the first draft or even the final query

Re: MQL – Client and server to query your db in natural language

#25
post #19

Earlier quoted context omitted.

:D We have been working with many non-tech founders and business people who are genuinely interested in data but they cannot learn SQL, due to different constraints.

What are those constraints? Really usable SQL for Business people can be learnt in a day long workshop or less time. If they can do Excel, they can do SQL too.

time, focus, priorities, or just curiosity to learn. people have their reasons. Nothing against SQL btw, but very difficult to make someone learn something, especially in authority. There must be people who have done it, it's not none or all, just needs curiosity & effort to learn.

Re: MQL – Client and server to query your db in natural language

#26
post #3

My experience with this kind of tool is that it is at least as hard to learn the tool as it is to learn the technology it abstracts over. I think that's because thinking about the problem I am trying to solve is always the hardest part and I have to learn a syntax and semantics no matter what. And the syntax and semantics of SQL is mathematically linked to the mathematics of relational databases. Natural language isn…

Agreed. Dozens of companies have built and sold "business intelligence" tools and report builders and visual query interfaces, all promising to ease the interface between man and data and make information easily accessible. And then every one of these tools turns out to only be usable (barely) by some "data analysts" and never by the executives to whom the system was originally sold.

I think this boils down to fundamental complexity and information theory.

Meaning, that's there's a certain amount of complexity involved in solving any problem. While abstractions are great and useful, they reduce (by their nature) specificity (and consequently, functionality).

We see this issue over and over again with "no code" and "low code" platforms, which are great for to-do apps, but as soon as you get into real-world application requirements, the platform needs to become so complex it's easier to just use a programming language to solve the problem (bubble is a good example).

I think the same issue applies to data querying, but perhaps more-so.

The problem domain is different. Most of the time accuracy is the most important constraint with data queries. For example, if I need to get a list of patients to notify about a drug recall, "mostly correct" isn't going to cut it.

So then the problem becomes developing a language that's specific and can accurately describe and model the problem. Spoken languages aren't great at that. By the time you contort a language like english into a form that can accurately and consistently describe the query, it's probably easier to just use a language that was designed for querying, like SQL or PRQL, etc...

In fact, spoken languages are so terrible at describing problems an entire industry of business analysts, project managers, UX experts and others exist just for the purpose of translating what people need into what's delivered.

I doubt ML models are going to ever replace that. They're sure to provide assistance, but a statistical model is just that - no matter how many of them you chain together, how big it is, or how you weight the model.

Re: MQL – Client and server to query your db in natural language

#27
post #23

Earlier quoted context omitted.

The people that hire data analysts do.

Is this to be trusted with things that have to be accurate such as a subpoena ? Besides, I feel like a data analyst should be able to know what questions to ask, not just how to translate business requests to sql.

If you have to be accurate, "natural language" is not going to be the way to do it.

Re: MQL – Client and server to query your db in natural language

#28

Genuine question: does anyone here actually want to query their database with natural language?

It's really helpful with MongoDB Query Language (also MQL). Document models without a rigid schema and a less intuitive API are where this stuff comes in real handy. MongoDB's GUI Compass already shipped a feature to generate queries and aggregation pipelines from natural language.

Re: MQL – Client and server to query your db in natural language

#29

Or one could, you know, learn SQL.

Most people would rather work in languages they already know. Natural language processing will allow programming languages to become as niche as assembly is, essentially. You won't need to interface with it much because the models will get that good.

Re: MQL – Client and server to query your db in natural language

#30
post #19

Earlier quoted context omitted.

What are those constraints? Really usable SQL for Business people can be learnt in a day long workshop or less time. If they can do Excel, they can do SQL too.

time, focus, priorities, or just curiosity to learn. people have their reasons. Nothing against SQL btw, but very difficult to make someone learn something, especially in authority. There must be people who have done it, it's not none or all, just needs curiosity & effort to learn.

Agreed. It matches my experience as well. I boil it down to personality and orientation than seniority in the org honestly. I have seen VP/Director level people who secretly tinker in SQL alongside delegation 99% of the time. Those who want to learn SQL will do it soon and the rest have some kind of mental block.
Post reply on HN