(Find all correct answers)
a) select count(i) from (select 1 as i union select 2 union select null) v1 where i is null; b) select count(*) from (select 1 as i union select 2 union select null) v1 where i is null; c) select count(*) from (select 1 as i union select 2 union select null) v1 where i <=> null; d) select count(*) from (select 1 as i union select 2 union select null) v1 where i = null;
[ SQL Expressions (15%) - NULL Values ]
Answers:
a d
Check http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_equal-to
and http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count