Question 1: Return the names, IDS, and average salary of the top 10 employees who are Senior Engineers whose average salary is at least $110,000 in descending order. Question 2 : Find the top ten employees (names, IDs and total wages) who earned equal to or more than $200000 between 01/01/2000 and 01/01/2002. Order them in decreasing order. Assume salaries change every 12 months. For simplicity, ignore salaries that started or ended outside of the date range. Select e.emp_no, e.first_name, e.last_name, SUM(s.salary) as total_wages from employees e inner join salaries s on e.emp_no = s.emp_no where s.from_date >= '2000-01-01' and s.to_date group by e.emp_no, e.first_name, e.last_name having SUM(s.salary) >= 200000 order by SUM(s.salary) DESC LIMIT 10; Use a subquery to display the employee number and bottom 10 average salaries of the employees who are not 'Staff'.
Get Free Quote!
320 Experts Online