For some reason, a lot of these SQL alternatives seem to be syntactic preference and not much simpler or clearer than the original.
For some reason, a lot of these SQL alternatives seem to be syntactic preference and not much simpler or clearer than the original.
When properly styled with good indentation and syntax habits SQL is extremely readable.
But this is only for initial generation. After that, you should be using pure SQL.
I think what people really want is business rules and data cleaning and schema discovery.
If you had to use English against multiple source systems to and tons of joins, the sentence would be paragraphs.
Where I think there’s value is in using something like a data catalog to label business rules against a data warehouse, tied to dashboard queries and other common ones.
But that’s a hard problem and a unique model to every customer. And always changing.
You have to know SQL to use them. They produce a lot of code that looks correct and produces correct-looking results with subtle errors. So you can't just hand it to someone who doesn't know SQL and let them query the database, but that's the use case where something like this would be valuable. You have to be experienced with SQL and know all the peccadillos of the DB you're working with to check the query and output for correctness.
For someone like me who is experienced with SQL, I can write simple queries just as fast as I can figure out how to prompt the LLM to get what I want. Where a tool like this would be really helpful is if it could help me write more complex queries more quickly. However, it is non-trivial to get the LLM to generate complex queries that take into account all the idiosyncrasies of your specific data model. So again it ends up being much faster for me to just write the query myself and not involve the LLM.
Where I think LLMs go wrong with SQL is that to write good SQL you have to have a deep knowledge of the underlying data model, and the LLMs aren't good at that yet.
We're still fairly bullish on the LLM-to-SQL front though, but in the meantime PQL is a good bridge.
In short, it has a longer spec than famously-complex C++ while making a much less expressive language out of it.
Rather than an LLM, you can send your request for an SQL query directly to Donald D. Chamberlin, one of the original designers of SQL. Furthermore, he gets an ERD for your database.
What odds you get back a query that gives you correct answers?
The SQL generation works well out of the box and works better as you update the semantic layer. The semantic layer includes things like joins and measures (e.g. aggregate functions) that you'd want standard definitions for. For example, you don't want an LLM creating a definition for MRR on the fly. All the semantic definitions are plain SQL.
quick demo: https://www.loom.com/share/a0d3c0e273004d7982b2aed24628ef40?...