Ashies

ashih

Jan 14th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. select employee_name,a.employee_id from(select employee_id from works_sagarwal where salary >all (select salary from works_sagarwal where company_id=5 or company_id=4 or company_id=3))a
  2. inner join employee_sagarwal b on a.employee_id=b.employee_id;
  3.  
  4. select e.employee_name from employee_sagarwal e, company_sagarwal c where c.company_name='hwt'and e.city = c.city;
  5.  
  6. select employee_name from( select employee_id from works_sagarwal t where salary >(select avg(salary) from works_sagarwal s where t.company_id = s.company_id))a inner join
  7. employee_sagarwal b on a.employee_id=b.employee_id;
  8.  
  9. DELETE FROM works_sagarwal WHERE salary<1000 and employee_id IN (select e.employee_id from employee_sagarwal e where e.is_active='no');
  10.  
  11. UPDATE WORKS_sagarwal set salary = salary + salary*5/100 where works_sagarwal.employee_id in (select employee_id from employee_sagarwal where is_active='yes' and
  12. datediff(month,date_of_joining,getdate())<18);
Add Comment
Please, Sign In to add comment