salary<\/td> | Integer<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n where employee_id<\/em> is an employee’s ID number, name<\/em> is their name, months<\/em> is the total number of months they’ve been working for the company, and salary<\/em> is the their monthly salary.<\/p>\n\n\n\nSample Input<\/strong><\/p>\n\n\n\nemployee_id<\/th> | name<\/th> | months<\/th> | salary<\/th><\/tr><\/thead> |
---|
12228<\/td> | Rose<\/td> | 15<\/td> | 1968<\/td><\/tr> | 33645<\/td> | Angela<\/td> | 1<\/td> | 3443<\/td><\/tr> | 45692<\/td> | Frank<\/td> | 17<\/td> | 1608<\/td><\/tr> | 56118<\/td> | Patrick<\/td> | 7<\/td> | 1345<\/td><\/tr> | 59725<\/td> | Lisa<\/td> | 11<\/td> | 2330<\/td><\/tr> | 74197<\/td> | Kimberly<\/td> | 16<\/td> | 4372<\/td><\/tr> | 78454<\/td> | Bonnie<\/td> | 8<\/td> | 1771<\/td><\/tr> | 83565<\/td> | Michael<\/td> | 6<\/td> | 2017<\/td><\/tr> | 98607<\/td> | Todd<\/td> | 5<\/td> | 3396<\/td><\/tr> | 99989<\/td> | Joe<\/td> | 9<\/td> | 3573<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n Sample Output<\/strong><\/p>\n\n\n\nAngela\nMichael\nTodd\nJoe<\/code><\/pre>\n\n\n\n<\/span>Explanation<\/strong><\/span><\/h2>\n\n\n\nAngela<\/em> has been an employee for 1<\/strong> month and earns $3443<\/strong> per month. Michael<\/em> has been an employee for 6<\/strong> months and earns $2017<\/strong> per month. Todd<\/em> has been an employee for 5<\/strong> months and earns $3396<\/strong> per month. Joe<\/em> has been an employee for 9<\/strong> months and earns $3573<\/strong> per month. We order our output by ascending employee_id<\/em>.<\/p>\n\n\n\n<\/span>Solution – Employee Salaries in SQL<\/strong><\/span><\/h2>\n\n\n\n<\/span>MySQL<\/strong><\/span><\/h3>\n\n\n\nselect name from employee \nwhere salary > 2000 and months <10 \norder By employee_id;<\/pre>\n\n\n\n
|
|