SHARE
TWEET

Untitled

a guest Nov 16th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select distinct e.first_name, e.last_name from employees e join employees m on e.employee_id= m.manager_id;
  2.  
  3. select distinct department_name, first_name, last_name, hire_date, salary, (sysdate-hire_date)/365 as experience,  e.manager_id, e.employee_id from employees e join departments d on e.employee_id = d.manager_id where (sysdate-hire_date)/365 > 15;
  4.  
  5. select first_name,last_name, salary from employees where salary > (select avg(salary) as salary from (select avg(salary)as salary from employees group by department_id));
  6.  
  7. select max(salary) as highest_salary, min(salary) as lowest_salary, sum(salary) as sum_, avg(salary) as avg_salary from employees;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top