title: How can I make three columns my primary key
body: <p>Im trying to learn how to match two files together. But I'm trying everythng for 5 hours now... And still no idea what to do.</p>
  
  <p>The first file(600.000 rows) contains 4 columns:</p>
  
  <pre><code>Postal, Number, Houseletter, livingspace
  </code></pre>
  
  <p>The second file(7.000 rows) contains 4 columns:</p>
  
  <pre><code>Postal, Number, Houseletter, Furniturevalue
  </code></pre>
  
  <p>In my first file I have all the livingspaces from a big area and in my second file I have the Furniturevalue of a couple of adresses in that big area. </p>
  
  <p>I want to add to the adresses in my second file the livingspaces from file 1.</p>
  
  <p>So I imported the files in a database. </p>
  
  <pre><code>Table first file -&gt; Space
  Table second file -&gt; Furniture
  </code></pre>
  
  <p>Now i'm trying to make Primary keys to the tables:</p>
  
  <pre><code>Primary key --&gt; Postal, Number, Houseletter
  </code></pre>
  
  <p>But this doesn't work, because the columns are only unique when  Postal+Number+Houseletter, but not apart from each other.</p>
  
  <p>Does anyone know the next step? What do I have to do to make this query work:</p>
  
  <pre><code>SELECT postal, number, houseletter, furniturevalue, livingspace
  FROM space, furniture
  WHERE ( space.postal = furniture.postal
  AND     space.number = furniture.number
  AND     space.houseletter = furniture.houseletter)
  </code></pre>
  
  <p>Im trying to make with this query a new view with `postal, number, houseletter, furniturevalue, livingspace' 
  So data from two tables. 
  But first I need a solution for my problem with the primary key.</p>
  
  <p>Thanks for your help!</p>
  
  <p>ps: Im using sql in phpmyadmin</p>