anonymous types and dynamics

Anonymous types are compiled as internal. What is the impact of it? You can still inspect them using reflections, but you cannot access their properties from other assemblies using dynamic keyword. It will throw RuntimeBinderException.

count(*) vs count(name)

What do you expect from the following query?

select count(*) as total,
       count(id) as by_id, 
       count(first_name) as by_first_name,
       count(last_name) as by_last_name,
       count(birthdate) as by_birthdate
from people

If the people table has the following data:

| id | first_name | last_name | birthdate |
+----+------------+-----------+-----------+
| 1  | John       | Doe       |           |
| 2  |            | Anonymous |           |

The answer is:

 | total | by_id | by_first_name | by_last_name | by_birthdate |
 +-------+-------+---------------+--------------+--------------+
 | 2     | 2     | 1             | 2            | 0            |

It seems that all NULLs are not considered.