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 count(deptno) from employee?

  1. 1

  2. 3

  3. 2

  4. 4

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

The COUNT(column) function counts only non-null values. Among the deptno values (10, 20, 10, Null), three are non-null. Therefore, COUNT(deptno) returns 3. Distractors count the null value or count unique values instead.