Loading
Lesson 28
Courses / HackerRank SQL Problem Solving Solution Challenges
Employee Salaries | SQL Basic Select | HackerRank Solution

Video Transcript

Welcome to another lesson. I will do employee salaries from the basic select subsection of the SQL section hacker rank. So we're given the stable employee that has the columns employee ID, name, months, and salary. Write a query that prints the list of employee names, so we only care about employee names column, and having a salary greater than 2k per month and been employed for less than 10 months. So we have two conditions here for the where, right? We have the salary has to be greater than 2000 and the months has to be less than 10. So the result of ascending is sending employee ID. So we do an order buy for that on the employee ID column. So let's get to it. We're going to select and we want to care about name column from what's the table here employee where and we have two conditions, right? So the salary column that's an integer has to be greater than 2000 and we have another column for months has to be less than 10 months in the job here. And because we need to order by we do an order buy. And what's the column we want to sort by is the employee ID. And it's ascending so ASC, but ASC is default. So you can write it or not. So I can just eliminate it. It's implicitly ASC. Let's click submit code. And there you go. According to this data, those are the employees that make a salary greater than 2000 per month and been there on the job for less than 10 months. And we ordered by the ascending employee ID. And that's employee salaries.
No comments yet (loading...)
No comments yet (loading...)
Did you like the lesson? 😆👍
Consider a donation to support our work: