title: Join tables in sqlite with many to many
body: <p>I have the following database schema:</p>
  
  <pre><code>create table people (
      id integer primary key autoincrement,
  );
  
  create table groups (
      id integer primary key autoincrement,
  );
  </code></pre>
  
  <p>and I already have which people are members of which groups in a separate file (let's say in tuples of (<code>person id</code>, <code>group id</code>). How can I structure my database schema such that it's easy to access a person's groups, and also easy to access the members of a group? It is difficult and slow to read the tuples that I currently have, so I want this to be in database form. I can't have things like <code>member1</code>, <code>member2</code>, etc. as columns because the number of people in a group is currently unlimited.</p>