Empnum Empname Dept - Id: 'Yet To Assigned'
Empnum Empname Dept - Id: 'Yet To Assigned'
Write a query to get EmpNum, Name of all the employees who are not
yet assigned to any department.
UPDATE emp
SET dept_id = (SELECT dept_id
FROM dept
WHERE dept_name = 'Yet To Assigned')
WHERE dept_id IS NULL;
SELECT e.*
FROM emp e, dept d
WHERE e.dept_id = e.dept_id
AND d.dept_name = 'SALES'
AND e.emp_name LIKE '%N';
8. Write a query to get all employees who have joined in the month of
June.
SELECT *
FROM emp
WHERE TO_CHAR (hire_date, 'MON') = 'JUN';
OR
SELECT *
FROM emp
WHERE TO_CHAR (hiredate, 'MM') = '06';
10. Write a query which gives the count of employees for each of
the salary grade.
11. For research department get employees along with their manager
name.
12. Select all the employee who are reporting to the same manager
as that of the JAMES.
13. Get the employees who are elder than their managers.
SELECT *
FROM emp
WHERE sal > (SELECT AVG (sal)
FROM emp)
16 .if salary of each female employee is increased by 10% then what will
be the new average of the salaries of all employees. Get this using a
single query.
17. Write a query to list all the manager names along with total
salary earned by his immediate subordinates.
SELECT *
FROM (SELECT ename, sal
FROM emp
ORDER BY sal DESC)
WHERE ROWNUM <= 3;
20. From the given table, find those employees who are more than 21
years of age.