Must know CONCEPTS from Korth before attempting this:--
- Since the special value null indicates “value unknown or nonexistent,” any arithmetic operations (such as +,−, ∗, /) involving null values must return a null result. i.e. means 5+null = null.
IMP for this question:-Unlike arithmetic expression handling of null for aggregated attributes(here avg) is done in different way in sql , the operation deletes null values at the outset, before applying aggregation.
Extra Note:- Here after removal of null from outset If the resultant multiset is empty, the aggregate result is null. (means if every entry of marks column is null then result will be null)
Step1:-we run update query successfully so we left with Marks(15,25,35,null)
Step2:- Select avg(marks) from T1
Explanation:- Follow Concept#2
Here avg(marks) will first remove the null value from the multiset before applying aggregation.
so we left with Marks(15,25,35)
so avg will be (15+25+35) / 3 =25 Hence Option C is ans.