Skip to main content
All Questions

Top Earning Employees

Easy
Unlock 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

Related courses

Course

Data Analyst Interview Prep

Ace your data analyst interviews—whether you're targeting product, marketing, or business analyst roles. Tackle real take-home case studies, sharpen your technical and dashboarding skills, and get strategies from interviewers at top tech companies and startups.

Course

Data Science Interview Prep

Land your dream data science role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Practice statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.