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

List out the three types of page locks that can be held.

678


What are the 2 sqlcodes that are returned?

631


What is the connection string to connect to the DB2 Database ?

606


What is runstats and reorg in db2?

783


What are the various data types available in db2?

625






How do I import a csv file into db2?

552


Explain in detail about buffer manager and its functionalities?

551


What is bind plan?

600


What is null indicator in db2?

591


My sql statement select avg(salary) from emp yields inaccurate results. Why?

634


What is db2 instance?

585


What is consistency token in db2?

626


How to find the number of rows in a db2 table?

640


Is db2 a programming language?

594


what is utility for parm lib

1863