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]
+,!,&&,==, etcOperatorsfilter a == b + c || d >= e
()Parenthesesderive celsius = (fht - 32) / 1.8
\Line wrap1 + 2 + 3 +
\ 4 + 5
1,100_000,5e10Numbersderive { huge = 5e10 * 10_000 }
‘’,“”Stringsderive name = ‘Mary’
true,falseBooleansderive { Col1 = true }
nullNullfilter ( name != null )
@Dates & times@2021-01-01
`</code></td><td><a href="$888c529d898eb4d2.md#quoting">Quoted identifiers</a></td><td><code>selectfirst name`
#Comments# A comment
==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