1. Queries for nth maximum nth row?2. In one table there are 5 fields. Empno, ename, deptcd, managr_id, salary.Select the departments whose sum of the salary greater than the sum of salaries of any department?3. When index will be usd in the query?
You have a very large query say of 2000 lines. How would you check if the indexes are being used or not. Would you read all the lines of explain plan in plan table to get it? If yes, will it be feasible? Do you have any other method of checking this?
Query 1. select sal from emp e where sal < any (select sal from empwhere empno=e.Mgr) (o/p:11 row) query 2. select sal from emp e where sal < any (select sal from empwhere mgr=e.Empno) (o/p:1 row) what is the difference between the above 2 queries.