title: Apply the unique constraint to combinations of columns in SQL
body: <p>I have a table called product_attributes in a <code>MySQL</code> Database.  It consists of a product SKU (foreign key), an attribute label and an attribute value.  I need to ensure that combinations of SKU and attribute labels are unique.</p>
  
  <h2>EXAMPLE -</h2>
  
  <p><strong>inserting this would be</strong> <em>legal</em>  </p>
  
  <pre><code>{001, 'weight', '100 lbs'}
  {001, 'color', 'blue'}
  {002, 'weight', '200 lbs'}
  </code></pre>
  
  <p><strong>This would be</strong> <em>illegal</em></p>
  
  <pre><code>{001, 'weight', '100 lbs'}
  {001, 'weight', '200lbs' }
  </code></pre>
  
  <hr>
  
  <p>-How can enforce this constraint?<br>
  -Do I have to do this in my server-side language or can I configure my database to enforce this?<br>
  -What is this type of constraint called?</p>