title: How to auto populate fields from an excel spreadsheet into a web database
body: <p>I'm trying to figure out a way to create a webbased table that contains consolidated information, obtained from multiple excel spreadsheets. Currently we do a Vlookup function in excel and match the required fields with the values given. So for example:</p>
  
  <p>Product ABC requires the following information:</p>
  
  <p>SKU
  RSP
  COST
  QTY SOLD
  QTY IN STOCK
  ..etc</p>
  
  <p>Each of those respective values are stored in different excel sheets so sheet 1 will have product ABC, SKU, and RSP; sheet 2 SKU, COST, QTY SOLD, etc... The common factor between all the spreadsheets are the SKU numbers.</p>
  
  <p>Essentially we want to be able to match the product ABC with it's corresponding sku, cost etc.</p>
  
  <p>The question is, how would I go about doing it? I understand the php aspect of calling variables but I think the biggest challenge I have is structuring the database (can be in either MSSQL or MYSQL). Any ideas on how to set up the database?</p>
  
  <p>Update:</p>
  
  <p>Thanks for the response those links were very helpful! How do I effectively use primary and foreign keys to make sure this works. If I have an end result which is a table called "consolidated" how can I make sure that table pulls the correct lines and matches them? The skus are not in any particular order so will sql automatically know which ones to match with what because of their defined PK/FKs?</p>
  
  <pre><code>table 1    table2     table 3    consolidated table
  SKU        SKU        SKU         SKU  RSP    STATUS
  QTY        RSP        COST        QTY  COST
  DES       QTY-SOLD    STATUS      DES  QTY SOLD
  </code></pre>