SELECT emp_id, name, salary, NTILE(4) OVER (ORDER BY salary) AS quartile FROM employees;
Write your query and click "Run Query" (Ctrl + Enter) to see results and testcase validation.