title: Why two primary keys in a table is not allowed?
body: <p>I want to understand the reasoning behind why two primary keys are not allowed in same table by grammar of MySql. I understand composite key and this is not related to that.</p>
  
  <p>I could not understand why two separate primary key in same table is not allowed. But we can have one column as primary key and other column as unique and not null. Which practically acts as having two different primary keys as we can distinctly identify a row using any of these keys. Why the first one is not allowed but the later is?</p>
  
  <p>I was trying to figure out the logic but stumbled upon Rule 2 of Codd's 12 rules which says </p>
  
  <blockquote>
    <p>Each and every datum (atomic value) in a relational data base is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.</p>
  </blockquote>
  
  <p>Does combination of table name, primary key value and column should be unique for a single datum value or can we have multiple combinations which guarantees access? Why or why not?  </p>
  
  <p>Edit: Since the question was identified as possible duplicate, I will explain below how it is different
  Other similar question was </p>
  
  <blockquote>
    <p>Can I have multiple primary keys in a single table?</p>
  </blockquote>
  
  <p>The ans is <strong>NO</strong>.</p>
  
  <p>My question is <strong>why</strong>? <strong>What is the reasoning?</strong> </p>
  
  <p><strong>What is that Codd intends to say by rule no 2?</strong> </p>
  
  <p><strong>What problems would have occurred if multiple separate primary keys were allowed?</strong></p>