Top Earning Employees
EasyUnlock detailed company stats for this questionUpgrade
Given the employee database with the schema shown below, write a query to fetch the top 3 earning employees, including their IDs, names and salaries.
employees +---------------+---------+ | id | int | | first_name | varchar | | last_name | varchar | | salary | int | | department_id | int | +---------------+---------+
Your query should output a result in the following format:
id | first_name | last_name | salary ----+------------+-----------+-------- int | varchar | varchar | int
This question tests your understanding of a few basic SQL concepts like the ORDER BY and LIMIT. Here's our complete solution:
SQLselect id, first_name, last_name, salary from employees order by salary desc limit 3;
Related courses

Course

Course