Given a table with the following schema:
CREATE TABLE employees (
id INTEGER PRIMARY KEY,
Write a SQL query that returns the id, name, and salary of all employees with a salary greater than $50,000.
INSERT INTO employees (id, name, salary)
VALUES (1, 'John', 50000),
(2, 'Jane', 60000),
(3, 'Joe', 40000);
id | name | salary
2 | Jane | 60000
This solution is in SQL. Our A.I. can create solutions in multiple languages.
Please, fill in the answer to evaluate!
SELECT id, name, salary
WHERE salary > 50000;
The solution above is optimal because it uses the WHERE clause to filter the results.