Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Frequently Asked Questions in Interviews

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Gautam512

Active User


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

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

Hi All,

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

100 FAQ IN DB2


Thanks,
Gau
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
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

New 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
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
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
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

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
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Thu Sep 02, 2010 7:18 pm    Post subject:
Reply with quote

ajay_diaz wrote:
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


Ajay,

It should work if you use the sql like the below :

EXPLAIN ALL FOR
SELECT EMP_NAME
FROM EMP
WHERE EMP_SALARY > ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm
No new posts Where can i find Interview questions ... Elixir Mainframe Interview Questions 4 Sat Feb 20, 2016 12:38 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us