title: PRIMARY KEY definition in MySQL CREATE TABLE statement
body: <p>What's the difference between this code:</p>
  
  <pre><code>CREATE TABLE samples (
    sampleid INT(11) NOT NULL AUTO_INCREMENT,
    sampledate DATE NOT NULL,
    location VARCHAR(25) NOT NULL,
    PRIMARY KEY (sampleid)
  )
  ENGINE=InnoDB;
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>CREATE TABLE samples (
    sampleid INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    sampledate DATE NOT NULL,
    location VARCHAR(25) NOT NULL,
  )
  ENGINE=InnoDB;
  </code></pre>
  
  <p>code?</p>
  
  <p>So a separate PRIMARY KEY statement or as part of a column definition. Same question for UNIQUE INDEX and UNIQUE keyword in column definition.</p>