Write a query that prints a list of employee names (i.e.: thenameattribute) for employees inEmployeehaving a salary greater than $2000per month who have been employees for less than 100months. Sort your result by ascendingemployee_id.
Input Format
TheEmployeetable containing employee data for a company is described as follows:
whereemployee_idis an employee's ID number,nameis their name,monthsis the total number of months they've been working for the company, andsalaryis the their monthly salary.
Sample Input
Sample Output
Angela
Michael
Todd
Joe
Explanation
Angelahas been an employee for 1month and earns $3443per month.
Michaelhas been an employee for 6months and earns $2017per month.
Toddhas been an employee for 5months and earns $3396per month.
Joehas been an employee for 9months and earns $3573per month.
We order our output by ascendingemployee_id.
My Answer
select name
from employee
where salary > 2000
and months < 10
order by employee_id;
Result
Rose
Patrick
Lisa
Amy
Pamela
Jennifer
Julia
Kevin
Paul
Donna
Michelle
Christina
Brandon
Joseph
Jesse
Paula
Louise
Evelyn
Emily
Jonathan
Nancy
Benjamin
Roy
Diana
Christine