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

What is out parameter used for eventhough return statement can also be used in pl/sql?

0 Answers  


What is difference between ms sql and mysql?

0 Answers  


Where not exists in sql?

0 Answers  


What does over partition by mean in sql?

0 Answers  


How many commands are there in sql?

0 Answers  






Is oracle sql free?

0 Answers  


How many sql statements are used?

0 Answers  


what is autonomouse transaction?

3 Answers   Oracle,


Is inner join same as self join?

0 Answers  


what is a primary key? : Sql dba

0 Answers  


What are the data types allowed in a table?

3 Answers  


What are local and global Indexes and where they are useful.

0 Answers  


Categories