Saturday 23 March 2019

Employee Salaries:- HackerRank Solution in MYSQL

Problem:-


Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than  per month who have been employees for less than  months. Sort your result by ascending employee_id.
Input Format
The Employee table containing employee data for a company is described as follows:
where employee_id is an employee's ID number, name is their name, months is the total number of months they've been working for the company, and salary is the their monthly salary.
Sample Input
Sample Output
Angela
Michael
Todd
Joe
Explanation
Angela has been an employee for  month and earns  per month.
Michael has been an employee for  months and earns  per month.
Todd has been an employee for  months and earns  per month.
Joe has been an employee for  months and earns  per month.
We order our output by ascending employee_id.

Solution:-
Select Name
From Employee
Where Months<10 And Salary>2000
order by employee_id

No comments:

Post a Comment

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...