title: Keep Changes in SQLite Permanently
body: <p>Hello I am fairly new to the world of relational databases and SQLite, but I am in the process of trying to edit and combine multiple datasets in SQLite in R Markdown, and I was wondering if there is any way to make each change permanent. For example, in my first select statement here </p>
  
  <pre><code>SELECT id, avg(days) Average
  FROM data1
  GROUP BY id
  </code></pre>
  
  <p>And then after I have the column of averages, I would like to join one column from another dataset using the primary key like below:</p>
  
  <pre><code>SELECT data1.*, data2.purchases
  FROM data1
  LEFT JOIN data2
  ON data1.id=data2.id
  </code></pre>
  
  <p>But I want the changes from the first set to be permanent and applied when I try to alter the table further. Is there something that I am doing wrong? This is all in the SQLite insert in R markdown, so could my syntax also be causing this. Any help is appreciated.</p>