Q1.all the depts which has more then 10 empls? Q2.all the
dept which does not have any emply? Q3 all the emp which
does not have any dept? Q4 get all the emply detais with
the dept details it dept is exit otherwise any emp details?
Q5 how to debugg the dynamic sql and packages?

Answer Posted / krish

1)select deptno,count(*)
from emp having count(*)=0 group by deptno;
2)select deptno,count(*)
from emp having count(*)>10 group by deptno;
3)select empname from emp where deptno is null;
4)select emp.deptno,emp.ename,dept.deptno,dept.dname
from emp,dept
where emp.deptno=dept.deptno(+);

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a dirty read sql?

715


Is primary key clustered index?

688


Are null values same as that of zero or a blank space?

731


what is the different between now() and current_date()? : Sql dba

703


What are the benefits of triggers?

893






How to write pl sql program in mysql command prompt?

711


how to include comments in sql statements? : Sql dba

723


What is a behavioral trigger?

695


When is a declare statement required?

867


Why function is used in sql?

677


What is sql keyword?

755


How many tables can a sql database have?

710


What is the size of partition table?

740


What is the largest value that can be stored in a byte data field?

707


How do I sort a table in sql?

765