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'

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of logging in the db2 database?

645


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

553


What is a trigger in the db2 database?

596


B37 abend during spufi?

982


How can the firstname and the lastname from the emp table be concatenated to generate complete names?

746






How would the varchar column remarks defined?

635


Following a db2 update statement, what is the quickest way to compute the total number of updated rows?

624


What is performance tuning db2?

620


Which component is responsible for db2 startup and shutdown?

630


What is dbrm library?

578


What is null in db2?

575


How to check table size in db2 sap?

581


What are the benefits of using the db2 database?

662


What does sqlcabc has?

633


What is dclgen (declaration generator)?

603