SQL Queries- Say for Eg. Two Tables - EMP and Dept EMP Tables consist of Empno, Deptno, Mgrid, Empname, Location Dept Table Consist of Deptno, Deptname.
1. Write a query to select Department name for which there is more that 20 employees in a specific Department. List the deptname and no of employees. Deptno in Emp table is the primary key for deptno column in Dept Table.
2. Write a query to select Manager name for each employee. MGRID column in the emp table is the empid of the Manager. There should be self join query on the emp table.
RE: SQL Queries- Say for Eg.Two Tables - EMP an...
select e.empname from emp e emp e1 where e.empno e1.mgrid and e1.mgrid is not null;This will avoid any blanks..where the employee is himself is a manager.