Page 1 :
Emp, , Write « query to display max salary from emp table, , , , , , , , , , , , , , , , , , , , , , , , Compiler always execute, , , , , , inner query first then, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , To display all department names along with number of, employee working in that?, , Select dept, count(*) from emp groupby dept:, , output:, , Dept Count(*), , HR 2, MKT 2, It 1, , , , EID E_Name Dept Salary Select Max(Salary) from emp; Output: 50000 Single query, , a, , To display name who is taking max salary, , Outer query Serer query, 2 Amit MKT Select E_Name from emp where Salary= {Select Max(Salary) from emp):, (0000 ——_ 50000 > execute outer query, 3 Ravi HR 30000, Nitin mer Select &_name from emp where Salary=50000 — j4uiti query or sub queries, 4 y 0000 Output: Rohan, 5 Rohan IT To display second highest salary from emp table?, False, , , , , , , , 30000> 50000 RD, , , , , , , , 28000 © 50000 True output: 40000, To display Employee name who is taking second highest salary?, 40000, Select E_name from emp where salary=(Select Max(Salary) from emp where salary>(Select, Max(Salary)from emp)); 2nd level 40000 1st level, , 50000 Output: Nitin