by AskAI

Solutions:

Check these solutions from our community and artificial intelligence:
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.