title: I need to link 2 tables but I'm baffled how (python/sqlite)
body: <p>I've created a database with a table (customer table) that holds basic customer information and a column that stores a percentage number for the week. </p>
  
  <p>My issue is, I need to create a 2nd table (archive table) that stores all of these weekly,monthly and yearly percentage numbers and keeps it linked to the customer. (I'll be using this to calculate averages)</p>
  
  <p>Problem is, Even though I know I'll have to use a foreign key I have NO IDEA how to implement it or even if/how to use a primary key for the archive table. Here's an basic example of how it's currently set up.</p>
  
  <pre><code>"""CREATE TABLE customer (id INTEGER PRIMARY KEY, name TEXT, percentage INTEGER)"""
  </code></pre>
  
  <p>now here is the archive table I'm trying to develop</p>
  
  <pre><code>"""CREATE TABLE archive(week INTEGER, month TEXT, year VARCAR)"""
  </code></pre>
  
  <p>I don't even think I've created the right columns but for right now I need to know how would I set this archive table up so that it links to each customer and the numbers stored in the weekly, monthly, yearly columns.</p>