Find the Highest Paid Employee

Given a table of employee data, write a SQL query to find the highest paid employee.

Problem

Given a table of data with employee IDs, names, and salary values, write a SQL query to find the highest paid employee.
Example input:
+----+----------+--------+
| ID | Name     | Salary |
+----+----------+--------+
| 1  | John     | 10000  |
| 2  | Jane     | 12000  |
| 3  | Smith    | 15000  |
| 4  | Mark     | 11000  |
+----+----------+--------+
Example output:
+----+----------+--------+
| ID | Name     | Salary |
+----+----------+--------+
| 3  | Smith    | 15000  |
+----+----------+--------+

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by sarastevens
SELECT * FROM table ORDER BY Salary DESC LIMIT 1;

/*

The solution above is optimal because it uses the ORDER BY and LIMIT clauses to sort the table by salary in descending order and then return the first row.

*/

A.I. Evaluation of the Solution

The candidate's solution is optimal and demonstrates a complete understanding of the problem. The candidate's approach is straightforward and easy to follow.

Evaluated at: 2022-11-20 14:16:04