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

How is data stored on a disk?

0 Answers  


what is a table in a database ? : Sql dba

0 Answers  


What is the difference between the Primary and Foreign key?

7 Answers   Cap Gemini,


i have a table like this. cityno cityname mails 1 BANGALORE 8KM 2 HSR LAYOUT 20KM 3 MEJISTIC 30KM 4 JAYADEVA 55KM 5 ITPL 80KM 6 HEBBAL 115KM I HAVE DATA LIKE THIS I WANT O/P LIKE THIS DISTANCE NO.OFCITY 0-50KM 3 51-100KM 2 101-150KM 4 AND SO ON pls give me answer. i want urgent

6 Answers  


how many ways to get the current time? : Sql dba

0 Answers  






Does truncate need commit?

0 Answers  


discuss about myisam key cache. : Sql dba

0 Answers  


What normalization means?

0 Answers  


How to run sql*plus commands in sql developer?

0 Answers  


Is sql database free?

0 Answers  


What are synonyms in sql?

0 Answers  


how to achieve this problem?i am having table with two colums like empno,gender. in gender column, i am having records male,female like that .my final output will be male female 5 6

4 Answers   Hexaware,


Categories