Multiple choice technology databases

A employee table contain below values empno empname deptno salary 1 aaa 10 30000 2 bbb 20 25000 3 ccc 10 Null 4 ddd Null 35000 Select avg(salary) from employee?

  1. 0

  2. 30000

  3. 22500

  4. 35000

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The AVG function ignores NULL values. The average is computed using the non-null values: (30000 + 25000 + 35000) / 3 = 30000. Distractors either include the null value as zero or calculate the wrong average.