Professional Documents
Culture Documents
Siddardha - 24 08 2018.sql
Siddardha - 24 08 2018.sql
ans : select min(salary) from emp where emp in (select salary from emp order by
desc limit 3)
Question 3: find all Employee records whose First name containing the character "o"
or �e�, regardless of whether it is in the middle, start or end positions.
ans: select first_name from emp where first_name like '%o%' union select first_name
from emp where first_name like '%e%
Question 4: Write SQL Query to find department wise total salary while calculating
consider the persons whose salary is greater than average salary.
ans:
Question 5: How do you find all employees whose first name or last name should
contain �ha� and who are also managers.
ans: select * from emp where first_name like '%ha%' or last_name like '%ha%' and
manager_id =department_id;
Question 7: Write query to update salary as 500000 whose Last name contain 'e' and
whose department is Services or Insurance.
ans: