title: Composite Primary Key or Single Primary Key
body: <p>Is it better to have a single primary key, or use composite primary keys (usually, they are combination of one primary key and foriegn keys). I have examples below:</p>
  
  <p><strong>Composite Primary Key example:</strong></p>
  
  <p>AMeta <br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaText <br/></p>
  
  <p>BMeta <br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaID - Foreign Key to Table AMeta <br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaText <br/></p>
  
  <p>A <br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- AId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaId - Primary Key and Foreign Key to Table AMeta <br/>
  &nbsp;&nbsp;&nbsp;   --- AText <br/></p>
  
  <p>B <br/>
  <br/> 
  &nbsp;&nbsp;&nbsp;   --- BId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaId - Primary Key Foreign Key to Table BMeta <br/>
  &nbsp;&nbsp;&nbsp;  --- AId - Primary Key and Foreign Key to Table A <br/>
  &nbsp;&nbsp;&nbsp;   --- BText <br/>
  <br/><br/>
  <strong>Single Primary Key example:</strong></p>
  
  <p>AMeta <br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaText <br/></p>
  
  <p>BMeta <br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaId - Foreign Key to Table AMeta<br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaText <br/></p>
  
  <p>A<br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- AId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- AMetaId - Foreign Key to Table AMeta<br/>
  &nbsp;&nbsp;&nbsp;   --- AText <br/></p>
  
  <p>B<br/>
  <br/>
  &nbsp;&nbsp;&nbsp;   --- BId - Primary Key <br/>
  &nbsp;&nbsp;&nbsp;   --- BMetaId - Foreign Key to Table BMeta <br/>
  &nbsp;&nbsp;&nbsp;   --- AId - Foreign Key to Table A <br/>
  &nbsp;&nbsp;&nbsp;   --- BText <br/></p>
  
  <p>Which is the better Database Design?</p>