title: Understanding SUM(NULL) in MySQL
body: <p>Usually when <code>NULL</code> is involved in any equation then the whole result resolves into <code>NULL</code> (e.g. <code>SELECT 2 + NULL + 5</code> returns <code>NULL</code>)</p>
  
  <p>Same holds for the following case:</p>
  
  <p><code>SELECT SUM(NULL)</code> returns <code>NULL</code>. <code>Proposition #1</code></p>
  
  <p>What happens when <code>SUM</code> is used to aggregate a column and the column can contain <code>NULL</code> values too ?</p>
  
  <p>Based on the <code>proposition #1</code> why the output doesn't result in <code>NULL</code>.</p>
  
  <pre><code>CREATE TABLE t (age INT NULL);
  
  INSERT INTO t (age)  VALUES (15),(20), (NULL), (30), (35);
  
  SELECT 
  SUM(age)
  FROM t;
  </code></pre>
  
  <p><strong>Output:</strong> <code>100</code></p>
  
  <p>But I was expecting <code>NULL</code>. </p>
  
  <p><em>Does MySQL silently skips those NULL values in this case?</em></p>
  
  <p><a href="http://sqlfiddle.com/#!9/3f99bb/2">http://sqlfiddle.com/#!9/3f99bb/2</a></p>