I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER
DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LOCATION
AND DEPT_TABLE CONTAINS DEPTNO,DOJ(DATE OF JOINING).I WANT
TO DISPLAY NAME,DEPTNAME,DOJ AND WHO ARE JOINED BETWEN 01-
JAN-2007 TO 01-JAN-2008?

Answers were Sorted based on User's Feedback



I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / nimsatprasad

Try this if wrong let me know...

SELECT A.NAME
,A.DEPTNAME
,B.DOJ
FROM EMP_TABLE A
,DEPT_TABLE.EMP_TABLE B
WHERE A.DEPTNO = B.DEPTNO
AND B.DOJ BETWEEN '01-01-2007' AND '01-01-2008'
;

Is This Answer Correct ?    14 Yes 2 No

I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / amlan roy

Select...........
from....
........
where DEPT_TABLE.DEPNO = EMP_TABLE.DEPNO.
AND DOJ between '01/01/2007' and '01/01/2008'

Is This Answer Correct ?    11 Yes 1 No

I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / harsha

select e.name,e.deptname,d.doj from emp_table e,dept_table d
where e.deptno=d.deptno and doj between '01-jan-2007' and
'01-jan-2008'

Is This Answer Correct ?    5 Yes 2 No

I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / arul

Select a.Name,a.DeptName,b.doj From Emp_Table as
a,Dept_Table as b Where a.Deptno=b.deptno and b.doj
between '01-jan-2007' And '01-jan-2008'

Is This Answer Correct ?    3 Yes 2 No

I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / ramesh

select e.name,e.deptname,d.doj from emp_table e,dept_table d
where e.deptno=d.deptno and doj between '01-jan-2007' and
'01-jan-2008';

Is This Answer Correct ?    0 Yes 0 No

I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LO..

Answer / s

select name.deptname.doj from emp_table innerjoin dept_table
on emp_table.deptno = dept_table.deptno

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More DB2 Interview Questions

pls tell me abt the normalization five types....

2 Answers  


How does one remove entries from the SCT02 table?

1 Answers  


What are catalog tables in db2?

0 Answers  


what is difference between Plan and Package

1 Answers   Syntel,


why we go for SPUFI for creating tables or for sql queries?

4 Answers  






i know the stpes 2 create an executable CICS/DB2 cobol code. 1. DB2 Precompiler converts the SQL Statements into COBOL API statements and creates another member with Acess plans. CodeA results in CodeB (code with API calls) & CodeC ( Access Plans ) 2.Code B is compiled/linked 2 create an exceutable.(codeE) 3.Now CodeC is binded to the database on which CodeE will be run. Can somebody provide me the sample JCLs for precompile/compile/link/bind.

0 Answers  


How can you find out the # of rows updated after an update statement?

0 Answers  


what is plan? is plan executable or package?

4 Answers  


Can SQL statements/queries be included in a copybook?

2 Answers  


What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?

3 Answers   Tech Mahindra,


select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?

2 Answers  


What is the result of open cursor statement?

0 Answers  


Categories