From

Specifies a data source.

PRQL

  1. from artists

SQL

  1. SELECT
  2. *
  3. FROM
  4. artists

To introduce an alias, use an assign expression:

PRQL

  1. from e = employees
  2. select e.first_name

SQL

  1. SELECT
  2. first_name
  3. FROM
  4. employees AS e

Table names containing spaces or special characters need to be contained within backticks:

PRQL

  1. from `artist tracks`

SQL

  1. SELECT
  2. *
  3. FROM
  4. "artist tracks"

default_db.tablename can be used if the table name matches a function from the standard library.

Note

We realize this is an awkward workaround. Track & 👍 #3271 for resolving this.

PRQL

  1. default_db.group # in place of `from group`
  2. take 1

SQL

  1. SELECT
  2. *
  3. FROM
  4. "group"
  5. LIMIT
  6. 1