Single item is coerced into a list

PRQL

  1. from employees
  2. select salary

SQL

  1. SELECT
  2. salary
  3. FROM
  4. employees

Same as above but with salary in a list:

PRQL

  1. from employees
  2. select [salary]

SQL

  1. SELECT
  2. salary
  3. FROM
  4. employees

Multiple items

PRQL

  1. from employees
  2. derive [
  3. gross_salary = salary + payroll_tax,
  4. gross_cost = gross_salary + benefits_cost
  5. ]

SQL

  1. SELECT
  2. *,
  3. salary + payroll_tax AS gross_salary,
  4. salary + payroll_tax + benefits_cost AS gross_cost
  5. FROM
  6. employees

Same as above but split into two lines:

PRQL

  1. from employees
  2. derive gross_salary = salary + payroll_tax
  3. derive gross_cost = gross_salary + benefits_cost

SQL

  1. SELECT
  2. *,
  3. salary + payroll_tax AS gross_salary,
  4. salary + payroll_tax + benefits_cost AS gross_cost
  5. FROM
  6. employees