1. List first name,last name and the current salary of all current employees making more than $90,000 (assume that for current employees to_date field = ‘9999-01-01’ ).
2. List first name,last name and the department name of all current employees whose current department number is “d008” or “d009”
3. List first name,last name and the title of all current female employees who have the title as “Technique Leader”.
4. List first name,last name and the current salary of all the current employees except “Senior Engineer”. (lowest salaries first)
5. List the first name,last name, and the birth date all employees (current and past – youngest employee first)
6. List the first name and last name of all current employees who are department managers in all current departments.
7. List the first name,last name and current department of the employee who is paid the maximum salary(one line of output only)
Expert Answer
Providing the responses for the first 5 queries:
1) select e.first_name,e.last_name,s.salary from employees e, salary s where s.salary > 90000;
2) select e.first_name,e.last_name,d.dept_name from employees e,departments d where d.dept_no IN (‘d008′,’d009′);
3) select e.first_name,e.last_name,t.title from employees e, titles t where e.gender=’F’ AND t.title=’Technique Leader’;
4) select e.first_name,e.last_name,s.salary from employees e, titles t,salary s where t.title <> ‘Senior Engineer’ order by s.salary ASC ;
5) select e.first_name,e.last_name,e.birth_date from employees e order by e.birth_date DESC;