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
Answer / rama krishna reddy
b
if no matching records found then it will return null value
| Is This Answer Correct ? | 36 Yes | 3 No |
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 |
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 |
Answer / mr.perfect
error +100 we will get, record not found.......
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
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 |
Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
Normalization in DB2 – first normal form, second normal form
in GDG: is it poosible to copy records from a file which utilizes some 100 cylinders to a gdg whose model is defined as trk(1,0) and also it possible to copy 100 bytes file to 80 bytes file?
What is the maximum number of tables that can be stored on a Partitioned Table Space ?
What is a Resource Control Table(RCT)? Describe its characteristics.
in column y record abc.v abc.s xyz.j abc.h i wan only abc columns how to retrieve thi records
what is the use of commit ? and what is the syntax?
What is dclgen in db2?
What is netezza database?
What is Declaration Generator(DCLGEN)?
when we are trying to update db2 rows. if the program abends . how we will know that the last successful update row was
Lot of updates have been done on a table due to which indexes have gone haywire. What do you do?