title: Count number of NULL values in each column in SQL
body: <p>I am trying to write a script that will show the number of non-null values in each column as well as the total number of rows in the table. </p>
  
  <p>I have found a couple ways to do this:</p>
  
  <pre><code>SELECT sum(case my_column when null then 1 else 0) "Null Values",
     sum(case my_column when null then 0 else 1) "Non-Null Values"
  FROM my_table;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT count(*) FROM my_table WHERE my_column IS NULL 
  UNION ALL
  SELECT count(*) FROM my_table WHERE my_column IS NOT NULL
  </code></pre>
  
  <p>But these require me to type in each column name manually. Is there a way to perform this action for each column without listing them?</p>