Beruflich Dokumente
Kultur Dokumente
write the query hike the employee�s salaries 30% who are working in the Banking
Department.
2.Increase employee salaries as 1000 where employee first_name last but one letter
end with O
ans : update emp set salary =(salary+1000) where first_name like '%o_' ;
3.Write a query display details whose firstname and lastname contains only 5
letters?
4.Display the employee details whose experience is more than minimum experience
employee.
6.Write a query display the maximum salary employee details working under Banking
and Insurance department
ans : select * from emp where salary in (select max(salary) from emp group by
department) and department in ('Banking','Insurance')
select first_name, avg(salary) over(partition by department) from emp
9.Write a query to get the first 5 characters from person�s name, if name does not
have 5 characters get their actual name.
ans : select left(first_name,5) from emp where length(first_name)>5 union select
concat_ws(' ',first_name,last_name) from emp where length(first_name)<5
select case when length(first_name)>5 then left(first_name,5) else
concat_ws(' ',first_name,last_name) end from emp1