Introduction
PRQL
SQL
SELECT
title,
country,
salary + COALESCE(tax, 0) + benefits_cost AS _expr_0,
salary + COALESCE(tax, 0) AS _expr_1
FROM
employees
start_date > DATE '2021-01-01'
SELECT
title,
country,
AVG(_expr_1),
SUM(_expr_0) AS sum_gross_cost,
CONCAT(title, '_', country) AS id,
LEFT(country, 2) AS country_code
FROM
_expr_0 > 0
GROUP BY
title,
country
HAVING
SUM(_expr_0) > 100000
ORDER BY
sum_gross_cost,
country DESC
20