title: I'm making an SQLite database but I have many similar tables - is there a way to combine them?
body: <p>So I'm trying to store price and volume information of products on an in-game &quot;stock market&quot;, and the data available is the current buy price, sell price, amount of items sold in the last 7 days, and amount of items bought in the last 7 days.</p>
  <p>Right now, I have a table for the buy prices from the last 24 hours, with the columns (time, item1, item2, item3, ...) and in each row, there's a timestamp, and then a price of each item at that time.</p>
  <p>I then have a nearly identical table for sell price, buy volume, and sell volume (meaning, the column names are the same, but the data stored is different).</p>
  <p>To recreate the tables:</p>
  <pre><code>CREATE TABLE buy_prices (
  time INTEGER NOT NULL,
  item1 INTEGER NOT NULL DEFAULT 0,
  item2 INTEGER NOT NULL DEFAULT 0,
  ...
  itemN INTEGER NOT NULL DEFAULT 0
  );
  </code></pre>
  <p>repeat for table sell_prices, buy_volume, and sell_volume</p>
  <p>On a set interval, the table buy_prices is updated with</p>
  <pre><code>INSERT INTO buy_prices(time, item1, item2, ... itemN) 
  VALUES (api_response['lastUpdated'], api_response['item1']['buy'], api_response['item2']['buy'], ... api_response['itemN']['buy']);
  </code></pre>
  <p>and then similar for sell_prices, buy_volume, sell_volume (with different keys for the api responses)</p>
  <p>This is my first time making a database so I feel like I'm missing something glaringly obvious, but is there a way to combine all of these into one table? In my head I was thinking of something like a dictionary where each cell would store all 4 values, but I don't know if this is possible, nor if this is something reasonable.</p>
  <p>tl;dr should I have many similar tables, or is there a solution with many values in each cell?</p>