Find all employees with a salary greater than $50,000

This technical problem involves writing a SQL query that returns the id, name, and salary of all employees with a salary greater than $50,000.

Problem

Given a table with the following schema:
CREATE TABLE employees (
id INTEGER PRIMARY KEY,
name TEXT,
salary INTEGER
);
Write a SQL query that returns the id, name, and salary of all employees with a salary greater than $50,000.
Example input:
INSERT INTO employees (id, name, salary)
VALUES (1, 'John', 50000),
(2, 'Jane', 60000),
(3, 'Joe', 40000);
Example output:
id | name | salary
----+-------+--------
2 | Jane | 60000

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by sarastevens
SELECT id, name, salary
FROM employees
WHERE salary > 50000;

/*

The solution above is optimal because it uses the WHERE clause to filter the results.

*/

A.I. Evaluation of the Solution

The solution above is optimal because it uses the WHERE clause to filter the results.

Evaluated at: 2022-11-07 06:15:20