Is it possible to have unique + null I have a need to have a database table that has a column that is either null, or unique values. I know I can control that in code, but is there a way to do that with an index as a backup? Or is that just really bad DB design? :) For example, I don't want to require an email address, but if they do enter one, I don't want to allow duplicates. Easy enough to check with my code, but I would like to configure Mysql to enforce it. Maybe a trigger returning false if the rules are violated?
For all engines, a UNIQUE index permits multiple NULL values for
  columns that can contain NULL.


http://dev.mysql.com/doc/refman/5.7/en/create-index.html

It is easily testable, just try to insert multiple NULL values in dummy table.