Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
100 Common DB2 Questions Asked in Interviews

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
Gautam512

Senior Member


Joined: 05 Oct 2005
Posts: 347
Location: Vizag / US

PostPosted: Wed Jan 04, 2006 11:16 am    Post subject: 100 Common DB2 Questions Asked in Interviews
Reply with quote

Hi All,

Here is the attached document of 100 frequently asked DB2 interview questions.

Thanks,
Gau
Back to top
View user's profile Send private message
References
PostPosted: Wed Jan 04, 2006 11:16 am    Post subject: Re: 100 Common DB2 Questions Asked in Interviews Reply with quote

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 279
Location: India

PostPosted: Wed Jun 14, 2006 11:21 am    Post subject:
Reply with quote

Hi,
Your document is really nice.

It seems that the answer to quetion # 20 seems to be wrong.

Quote:
20. What is the result of this query if no rows are selected?

SELECT SUM(SALARY)

FROM EMP

WHERE QUAL='MSC';

A. NULL
Back to top
View user's profile Send private message
Rajen

Active User


Joined: 05 May 2005
Posts: 61

PostPosted: Tue Dec 12, 2006 7:06 pm    Post subject: Re: 100 Common DB2 Questions Asked in Interviews
Reply with quote

Hi Parikshit,
Really nice observation.

I guess this answer is partly right.

We have query as below.

SELECT SUM(SALARY)
FROM EMP
WHERE QUAL='MSC';

Now this will return NULL only if
1)All the rows fetched by Where condition has value of column SALARY equal to NULL. For example if the result table contains 10 rows and all these 10 rows are having SALARY value NULL then the above query will return NULL

2) Now if any of the rows in the result table is having ZERO (0) value then it will return ZERO.

So its like NULL + NULL + NULL + NULL = NULL and
NULL + NULL + NULL + 0 = 0.

Please correct me if i am wrong.

Thanks,
Rajen.
Back to top
View user's profile Send private message
sachin_star3

Active User


Joined: 30 Sep 2006
Posts: 53
Location: pune

PostPosted: Sun Jan 14, 2007 11:23 pm    Post subject: Re: 100 Common DB2 Questions Asked in Interviews
Reply with quote

hi
sorry you are wronge
In coloumn function when no row written ie. in where clause condition not satishfied then output is NULL.(NOT RELATION ABOUT THE COLOUMN IS NULL OR NOT) EXCEPT COUNT FUNCTION,IN COUNT WHEN NO ROW FECHED i.e conition in where clause is not satishfied ,THEN ANS IS ZERO


AND ABOUT NULL COLOUMN :- ALL COLOUMNS FUNCTION NOT COUNT THE ROW WHERE THERE IS NULL , BUT EXCEPT COUNT(*) FUNCTIONS ALSO COUNT THE NULL COLOUMN BECAUSE IT IS ACTE4D ON ROW NOT COLOUMN

FROM-SACHIN
PUNE
Back to top
View user's profile Send private message
nitin-mainframe
Currently Banned

New User


Joined: 01 Mar 2007
Posts: 4
Location: pune

PostPosted: Fri Apr 20, 2007 3:31 pm    Post subject: Re: 100 Common DB2 Questions Asked in Interviews
Reply with quote

Gautam512 wrote:
Hi All,

Here is the attached document of 100 frequently asked DB2 interview questions.

Thanks,
Gau
kaha hai bhai attachment where is the ttach ment i am not geeting yarr?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7998
Location: 221 B Baker St

PostPosted: Fri Apr 20, 2007 7:27 pm    Post subject:
Reply with quote

Hello,

The attachment is in the initial post. If you right-click on "Download" you may open it or save it.
Back to top
View user's profile Send private message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 22

PostPosted: Thu Jul 05, 2007 7:16 am    Post subject:
Reply with quote

Question 43 is:
How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause.)
A. Use a question mark in place of a host variable ( or an unknown value ). e.g.
SELECT EMP_NAME
FROM EMP
WHERE EMP_SALARY > ?

I tried doing that but I am getting error message
Invalid use of "?".

Can anybody please help?

Thanks
Ajay
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1