Challenge #6
Question
Consider the following employees table:
employees
Exercise
Write a SQL query to retrieve the names of employees who have a salary greater than $50,000, and list the employee names in alphabetical order.
The solution to this exercise can be found below - please take some time to work on the solution by yourself first before reading any further.
Solution
Query
Please note that the code below may not be visible if you are reading this article in your email. Kindly read the article on LinkedIn to access it.
SELECT employee_name
FROM employees
WHERE salary > 50000
ORDER BY employee_name;
Result
SQL Tips
Feel free to comment your findings!
If you don't want to miss the carefully crafted SQL challenges every week, subscribe to my Newsletter. Elevate your skills through practice and unlock expert tips; be on top of your game!
Senior Software Developer @ Dayforce | Tech Enthusiast | Co-Founder of TechNews
1 年What if I want to know the percentage of employees making between $30000 and $50000? ??