what will be the output of the below given query, if no
matching records are found : (a.) 0 (b.) null (c.) error

select Avg(salary)
from TableA
where Deptno = 'insurance'

Answers were Sorted based on User's Feedback



what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / rama krishna reddy

b

if no matching records found then it will return null value

Is This Answer Correct ?    36 Yes 3 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / guest.

Lalit, I contradict your answe because the question itself
says that there is no matching record with
deptno='insurance'. So (b)is the correct answer.

Is This Answer Correct ?    20 Yes 1 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / varalakshmi

ANSWER IS B. IT GIVES NULL.

Is This Answer Correct ?    20 Yes 4 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / guest

NULL

Is This Answer Correct ?    2 Yes 2 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / pankaj

ans is a) ZERO

the anser is ZERO because there is no record in the table
they can shows the zero value present in the table


0 record is selected

message is disply

Is This Answer Correct ?    2 Yes 2 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / mr.perfect

error +100 we will get, record not found.......

Is This Answer Correct ?    0 Yes 0 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / shailendra

It will be error, as we are using where with AVG function....we should use having

Is This Answer Correct ?    0 Yes 0 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / swapnil

It depends up on the which database we are using. I m using
PostgreSQL it is in open source.It returns 0 value.

Is This Answer Correct ?    1 Yes 2 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / lalit

Hi,
My understanding is different so it can be a or b. Assume
that there are 10 records and this column can have null
values. If 9 records have null and one record has vale as
zero then the answer would be zero and if all of them have
null then the answer would be null. If no rows satifies the
criteria then it would be null.

Is This Answer Correct ?    5 Yes 7 No

what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) ..

Answer / vinay

answer is

(a.) 0

0 recod selected.

Is This Answer Correct ?    7 Yes 19 No

Post New Answer

More DB2 Interview Questions

Define predicate?

0 Answers  


What is a Database Request Module(DBRM)?

4 Answers  


Is it possible using max on a char column?

0 Answers  


Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

0 Answers  


What is a precompiler?

2 Answers  






Once you create a view, where would information about the view be stored?

1 Answers  


How does one remove entries from the SCT02 table?

1 Answers  


select 100 records from million records ?

2 Answers   Verizon,


what is the process of precompiler?

2 Answers  


What db2 400?

0 Answers  


Can we declare DB2 HOST variable in COBOL COPY book?

2 Answers  


How do you concatenate the firstname and lastname from emp table to give a complete name?

0 Answers  


Categories