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

What is a db2 cursor?

0 Answers  


Can we use select * statement in cobol program without giving field names ???

3 Answers   Zensar,


5 rows are inserted to a DB2 Table. Next 3 of those are updated, then a rollback is issued. What would happen when the rollback is issued?

2 Answers  


How does DB2 use multiple table indexes?

1 Answers  


How do you find the maximum value in a column in db2?

0 Answers  






I have 3 cursors declared. Cursor1 retieves some data. Based on this curso2 will also fetches some data. In cursor3 (using for some updation) I'm using the data retrieved by the above 2 cursor. My question is, while working with cursor3, periodically if I give commit, will all the three crsors will be closed or only cursor3 will be closed?

4 Answers  


Which are the db2 tools to protect integrity of the database?

0 Answers   IBM,


What do you mean by NOT NULL? When will you use it?

3 Answers  


What are the three DB2 date and time data types and their associated functions?

1 Answers  


What is the specific need of Plan and..where are the tables in DB2 are physically saved

3 Answers   Infosys,


What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?

0 Answers   MCN Solutions,


can you use symbolic parameters in JOB?

5 Answers   IBM,


Categories