Syntax

A summary of PRQL syntax:

SyntaxUsageExample
|Pipelinesfrom employees | select first_name
=Assigns & Aliasesfrom e = employees
derive total = (sum salary)
:Named args & Parametersinterp low:0 1600 sat_score
[]Listsselect [id, amount]
! && || == +, etcExpressions & Operatorsfilter a == b + c || d >= e
()Parenthesesderive celsius = (fahrenheit - 32) / 1.8
‘’, “”Stringsderive name = ‘Mary’
`</code></td><td><a href="$90360498d63ac010.md">Quoted identifiers</a></td><td><code>selectfirst name`
#Comments# A comment
@Dates & Times@2021-01-01
==Self-equality in joinjoin s=salaries [==id]
->Function definitionsfunc add a b -> a + b
=>Case statementcase [a==1 => c, a==2 => d ]
+/-Sort ordersort [-amount, +date]
??Coalesceamount ?? 0