title: What's the point of adding NOT NULL to primary key field in MySQL?
body: <p>What's the point of adding <code>NOT NULL</code> to a <em>primary key</em> field? Primary key is already <em>not null</em> + <em>unique</em>.</p>
  
  <p>Here is an example:</p>
  
  
  
  <pre><code>CREATE TABLE student (
    id int(11) AUTO_INCREMENT NOT NULL,
    name varchar(255),
    PRIMARY KEY(id)
  )
  </code></pre>
  
  <p>Why not to define it like this instead:</p>
  
  <pre><code>CREATE TABLE student (
    id int(11) AUTO_INCREMENT,
    name varchar(255),
    PRIMARY KEY(id)
  )
  </code></pre>