#### Find the second highest salary in a SQL table.

Write a SQL query to find the second highest salary from the employees table. The table has columns for id and salary. The query should return the salary column.

#### Problem

```Write a SQL query to find the second highest salary from the employees table.
Example input:
+----+--------+
| Id | Salary |
+----+--------+
| 1  | 100    |
| 2  | 200    |
| 3  | 300    |
+----+--------+
Example output:
+--------+
| Salary |
+--------+
| 200    |
+--------+```

#### Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
```SELECT MAX(Salary) AS Salary
FROM Employee
WHERE Salary < (SELECT MAX(Salary) FROM Employee)

/*

The solution above is optimal because it uses a subquery to find the maximum salary and then uses that value to find the second highest salary.

*/```

A.I. Evaluation of the Solution

The solution above is optimal because it uses a subquery to find the maximum salary and then uses that value to find the second highest salary.

Evaluated at: 2022-11-06 01:44:53