Company: Google | Difficulty: easy
Find all employees with a salary greater than 70000.
employees
salary
70000
Write a query to list the name and salary of these employees. Sort the results by salary in descending order. If two employees have the same salary, sort their names in ascending alphabetical order.
name
Sundar Pichai, Ruth Porat, and Thomas Kurian are returned because their salaries are greater than 70000. Jeff Dean is excluded because the condition is strictly greater than 70000.
Sundar Pichai
Ruth Porat
Thomas Kurian
Jeff Dean
DROP TABLE IF EXISTS employees; CREATE TABLE employees ( name VARCHAR(100), salary INT ); INSERT INTO employees VALUES ('Sundar Pichai', 95000), ('Ruth Porat', 80000), ('Thomas Kurian', 75000), ('Jeff Dean', 70000);
← All SQL Challenges · Google Questions · Learn SQL Free