SQL: Select All Employees
Medium
SQL — Basics
SQL
SELECT
ORDER BY
Write a query to select all employees ordered by salary descending.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: id name salary
1 Ahmed 15000
2 Sara 12000
3 Omar 18000
Output:
Example 2:
Input: id name salary
1 Ahmed 15000
2 Sara 12000
3 Omar 18000
Output:
Hints
SELECT * FROM employees ORDER BY salary DESC;
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console