title: SQL: NOT NULL constraint on a set of columns
body: <p>Consider the following table:</p>
  
  <pre><code>CREATE TABLE user(
     first_name text,
     last_name text,
     ...
  )
  </code></pre>
  
  <p>I would like to be able to add users with either a first name, a last name, or both - but I won't allow a user without any name. In other words (thanks, @wildplasser) - at least one column should not be NULL.</p>
  
  <pre><code> INSERT INTO user(first_name, last_name) VALUES ("foo", NULL);  # 1. OK
   INSERT INTO user(first_name, last_name) VALUES ("foo", "bar"); # 2. OK
   INSERT INTO user(first_name, last_name) VALUES (NULL, "bar");  # 3. OK
   INSERT INTO user(first_name, last_name) VALUES (NULL, NULL);   # 4. NOT OK
  </code></pre>
  
  <p>Obviously, a <code>NOT NULL</code> constraint on each columns would disable examples 2 and 3.</p>
  
  <p>How can I express a <code>NOT NULL</code> constraint on a set of columns in SQL?</p>