PRQL

Pipelined Relational Query Language, pronounced “Prequel”

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement

For example, “Top N by group”:

from employees
group role (
  sort join_date
  take 1
)
WITH table_0 AS (
  SELECT
    *,
    ROW_NUMBER() OVER (
      PARTITION BY role
      ORDER BY
        join_date
    ) AS _expr_0
  FROM
    employees
)
SELECT
  *
FROM
  table_0
WHERE
  _expr_0 <= 1