PRQL – A proposal for a better SQL
I both love this (it's very well done!) and hate this, because I feel it misses the forest for the trees.It's like that meme "Nobody says 'I want to be an Excel guru when I grow up.'"SQL is just the means to an end - to alter or retrieve data in a system.We shouldn't be coming up with nicer ways to handle autocompletion, or recursive semantics, or windowing functions.SQL was created to be declarative and human-friendly, to be read aloud.The next evolution of SQL should be natural language.It should be bounded at the schema and enriched with as much context as it can, both about the domain of the data, the data itself, and its relationships within itself and to other schemas.I just want to see all the people in my organization who haven't submitted their timesheet this week; all the orders in my ERP that are waiting for parts from a specific vendor; how much lift I'm getting from my targeted marketing campaign. I just want to delete any contact from CRM who hasn't responded to an email in the last 45 days!I don't want SQL; I want something that translates natural language into a logical plan, and a physical plan; and a separate tool that allows me to express many, many natural language concepts for my bounded schema ... perhaps in a SQL-like way.Like a metrics / definition store on steroids, or just a sea of rich aliases and computed columns and subqueries that can be composed without stressing over syntax or newlines or ordering or complex join conditions.