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 / varalakshmi
ANSWER IS B. IT GIVES NULL.
Is This Answer Correct ? | 20 Yes | 4 No |
Post New Answer View All Answers
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is temporal table in db2?
What is host variable?
Where do you specify them?
Give a brief description of db2 isolation levels?
what is a corelated subquerry?
List out the buffer pools in db2
SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.
How to find the number of rows in a db2 table?
Mention the various locks that are available in db2.
How can you find out the # of rows updated after an update statement?
How to get the ddl of a table in db2?
What are the rules for db2 programming?
How many databases can be created inside an instance in db2 ?
How do you stop a db2 database in linux?