PRQL: Pipelined Relational Query Language
91–100 of 214 posts
Re: PRQL: Pipelined Relational Query Language
#92If the main complaint people have about SQL is that you can't swap SELECT, FROM and WHERE, then that's pretty good for a language designed in the 70s. This, by contrast, looks like it has a bunch of random line noise for syntax. Why on earth should I like this: `join side:left p=positions (p.id==employees.employee_id)` better than this: `LEFT JOIN positions AS p ON p.id = employees.employee_id` ?
I've had two real gripes with SQL. The rest of it has been, as you said, pretty good. Complaint 1: Not being able to use selected columns later in the same select. SELECT gnarly_calculation AS some_value, some_value * 2 AS some_value_doubled Instead: SELECT subquery.*, some_value * 2 AS some_value_doubled FROM ( gnarly_calculation AS some_value ) AS subquery Complaint 2: Not being able to specify all columns except .…
This video also covers many other advantages of ClickHouse's SQL dialect: https://www.youtube.com/watch?v=zhrOYQpgvkk
Some may find your first complaint questionable... But I specifically designed ClickHouse SQL to allow aliases to be used and referenced in every part of SQL query.
Re: PRQL: Pipelined Relational Query Language
#93Having spent more time in MongoDB aggregations than I'd like to lately, I really wish they'd support this. So much more sensible than the madness they've got going on.
(Disclaimer: I'm a PRQL contributor.)
Re: PRQL: Pipelined Relational Query Language
#94Earlier quoted context omitted.
I've had two real gripes with SQL. The rest of it has been, as you said, pretty good. Complaint 1: Not being able to use selected columns later in the same select. SELECT gnarly_calculation AS some_value, some_value * 2 AS some_value_doubled Instead: SELECT subquery.*, some_value * 2 AS some_value_doubled FROM ( gnarly_calculation AS some_value ) AS subquery Complaint 2: Not being able to specify all columns except .…
PRQL fixes this. (Disclaimer: I'm a PRQL contributor.)
Re: PRQL: Pipelined Relational Query Language
#95Earlier quoted context omitted.
I don't use PRQL but I absolutely get the appeal but specifically on the readability part, some things that are easy in PRQL are just awful in SQL. From the website for instance this is a nightmare to do in SQL: from employees group role (sort join_date take 1)
What does it mean? Is it the same as "LIMIT BY" in ClickHouse? https://clickhouse.com/docs/en/sql-reference/statements/sele...
Re: PRQL: Pipelined Relational Query Language
#96Earlier quoted context omitted.
I couldn't find that example right now but there is a similar line in the main example on the prql-lang.org homepage: aggregate { average total, ... } I can't definitively say why it is there, other than perhaps just to show that you can specify aggregations without having to give them an alias. The column name won't be pretty but if you're just interactively trying something out and want to see the results then you…
Gotcha. The thing that’s not immediately clear from the syntax is which columns I’m getting out as a final result of my query. I guess the last select you ran + any derived ones since then?
I once tabled a proposal whether each query should be forced to end with a `select` to make the final column list explicit. This could be generated by the compiler. It was felt that that wasn't necessary though and would also be somewhat arbitrary since you also need to know what columns are available at each previous step of the pipeline if you want to be able to make modifications. As the tooling improves, you could perhaps be shown the current list of columns as you hover over each line?
Re: PRQL: Pipelined Relational Query Language
#97Significant newlines. Non-obvious way to specify database/schema.
Re: PRQL: Pipelined Relational Query Language
#98There seems to be very little support for these SQL challengers despite many people saying SQL sucks and they want a redo. Why is that? Some guesses: - There is some popular non-sql query language that has gained lots of momentum that I just dont know about. - People are more effective with SQL because they know it so no new and especially existing databases will switch. This is definitely true to some extent, but if…
Re: PRQL: Pipelined Relational Query Language
#99[1] SQLPage: https://sql.ophir.dev
Re: PRQL: Pipelined Relational Query Language
#100Earlier quoted context omitted.
I don't get that - to me the examples are much less readable than SQL and I don't understand why I should want to use this. Like, yes, you can reorder the query sections, which seems to be everyone's complaint about SQL, but then you also have multiple types of brackets, colons and other syntax for no reason, all while not really accomplishing anything SQL doesn't already do. What's the attraction?
I don't use PRQL but I absolutely get the appeal but specifically on the readability part, some things that are easy in PRQL are just awful in SQL. From the website for instance this is a nightmare to do in SQL: from employees group role (sort join_date take 1)
from employees
group role (
sort join_date
take 1
)
or from employees | group role (sort join_date | take 1)
In English: Take the 1st employee
by (earliest) join_date
for each role
from the set of employees