[INST] Write a SQL query to find the second highest salary and its employee name. The salary is in a separate table called SALARIES and is connected via FK to EMPLOYEES./n [/INST]  ###Response: Here is a SQL query that would find the second highest salary and employee name:

```
SELECT e.employee_name, s.salary
FROM employees e
JOIN salaries s ON e.id = s.employee_id
WHERE s.salary = (
  SELECT MAX(s2.salary)
  FROM salaries s2
  WHERE s2.salary < (
    SELECT MAX(s3.salary)
    FROM salaries s3
  )
);
```

This query joins the `employees` and `salaries` tables on the employee ID, and then uses a subquery to find the maximum salary that is less than the overall maximum salary, which will give us the second highest salary. The outer query then selects the employee name and salary for the corresponding employee with that salary.