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

How do you filter out the rows retrieved from a Db2 table ?

1 Answers  


how can you copy records present in a flat physical file to a database file(physical file).please explain in rpg400 with a simple example

1 Answers   CTS,


I have a main program (A) where we delete some rows in table in a cursor, and we commit it in sub program(B). What will happen - will we get an error or not?

2 Answers  


How to fetch the last row from the table in SQL (db2)?

0 Answers  


what is the difference between normal select query and currosor

2 Answers   Cap Gemini, TCS,






I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

2 Answers  


Explain about open switch business continuity software?

0 Answers  


How to create db2 table in mainframe?

0 Answers  


what's the equivalent Cobol Data type for Decimal(x,y) in DB2? what does the current SQLID register contain?

3 Answers   Cap Gemini, Tech Mahindra,


Which command is used to remove all rows from a table?

0 Answers  


suppose in my table 10 rows are there , i want to update odd rows salary as 90000 ? how u do it ? any one help me ? what do we use here cursor-fetch or normal sql ?

5 Answers   IBM,


Which transaction use a command thread ?

1 Answers  


Categories