Syntax

A summary of PRQL syntax:

SyntaxUsageExample
|Pipelinesfrom employees | select first_name
=Assignsfrom e = employees
derive total = (sum salary)
:Named args & parametersinterp low:0 1600 sat_score
{}Tuples{id, false, total = 3}
[]Arrays[1, 4, 3, 4]
! && == +Operationsfilter a == b + c || d >= e
()Parenthesesderive celsius = (fahrenheit - 32) / 1.8
‘’, “”Stringsderive name = ‘Mary’
`</code></td><td><a href="$888c529d898eb4d2.md#quoting">Quoted identifiers</a></td><td><code>selectfirst name`
#Comments# A comment
@Dates & times@2021-01-01
==Self-equality in joinjoin s=salaries (==id)
->Function definitionslet add = a b -> a + b
=>Case statementcase {a==1 => c, a==2 => d }
+/-Sort ordersort {-amount, +date}
??Coalesceamount ?? 0