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?

Answers were Sorted based on User's Feedback



Q1.all the depts which has more then 10 empls? Q2.all the dept which does not have any emply? Q3 a..

Answer / ramkiran

select emp.deptno,emp.ename,dept.deptno,dept.dname from
emp,dept
where emp.deptno(+) = dept.deptno
order by 1

Is This Answer Correct ?    3 Yes 0 No

Q1.all the depts which has more then 10 empls? Q2.all the dept which does not have any emply? Q3 a..

Answer / 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

More SQL PLSQL Interview Questions

write a qurey for finding the length of the sting.

6 Answers   Infosys, TCS,


What is a self join ?

6 Answers   BirlaSoft,


what are aggregate and scalar functions? : Sql dba

0 Answers  


Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?

0 Answers  


what are the different functions in sorting an array? : Sql dba

0 Answers  






Does sql backup shrink transaction log?

0 Answers  


Why truncate is used in sql?

0 Answers  


define sql insert statement ? : Sql dba

0 Answers  


Does pl sql work in mysql?

0 Answers  


Enlist the data types that can be used in pl/sql?

0 Answers  


How do I save the results of sql query in a file?

0 Answers  


Is json a nosql?

0 Answers  


Categories