title: NULL permitted in Primary Key - why and in which DBMS?
body: <p>Further to my question <a href="https://stackoverflow.com/questions/3905703/why-to-use-not-null-primary-key-in-tsql">&quot;Why to use ´not null primary key´ in TSQL?&quot;</a>...</p>
  <p>As I understood from other discussions, some RDBMS (for example SQLite, <del>MySQL</del>) permit &quot;unique&quot; NULL in the primary key.</p>
  <p>Why is this allowed and how might it be useful?</p>
  <p>Background: I believe it is beneficial for communication with colleagues and database professionals to know the differences in fundamental concepts, approaches and their implementations in different DBMS.</p>
  <h2>Notes</h2>
  <ul>
  <li>MySQL is rehabilitated and returned to the &quot;NOT NULL PK&quot; list.</li>
  <li>SQLite has been added (thanks to Paul Hadfield) to &quot;NULL PK&quot; list:</li>
  </ul>
  <blockquote>
  <p>For the purposes of determining the uniqueness of primary key values, <em>NULL values are considered distinct from all other values, including other NULLs.</em></p>
  <p>If an INSERT or UPDATE statement attempts to modify the table content so that two or more rows feature identical primary key values, it is a constraint violation. According to the SQL standard, PRIMARY KEY should always imply NOT NULL. Unfortunately, due to a long-standing coding oversight, this is not the case in SQLite.</p>
  <p>Unless the column is an INTEGER PRIMARY KEY <strong>SQLite allows NULL values in a PRIMARY KEY column</strong>. We could change SQLite to conform to the standard (and we might do so in the future), but by the time the oversight was discovered, SQLite was in such wide use that we feared breaking legacy code if we fixed the problem.</p>
  <p>So for now we have chosen to continue allowing NULLs in PRIMARY KEY columns. Developers should be aware, however, that we may change SQLite to conform to the SQL standard in future and should design new programs accordingly.</p>
  <p>— <a href="http://www.sqlite.org/lang_createtable.html#primkeyconst" rel="noreferrer">SQL As Understood By SQLite: CREATE TABLE</a></p>
  </blockquote>