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