title: How to set custom database keys?
body: <p>I am designing a database structure (SQLite on Android) that will consist of two tables, Containers(table 1) and Object/Container Data(table 2).</p>
  
  <p>Table 1 will contain a key for the containers data and a list of keys for the containers/objects within.
  Table 2 will contain the data for the object/container: title, description, category, pictures, etc.</p>
  
  <p>With this design I will be able to go to a container, get its data (title, image) and get a list of items it holds, in order, then search for each items data(image, possibly title). Then the user could click on an item and if it is an object go to its data, or if it is a container, repeat this process.</p>
  
  <p>How can I set the ID's for each table so that I can know which table an ID belongs to. For example, if an ID is even it points to table 1, if its odd, it points to table 2.</p>
  
  <p>I think I may have just found an answer that seems rather obvious now... I just have to test it out. Basically you can just set a custom ID by setting the ID to what you want when you create the row.</p>
  
  <pre><code>INSERT INTO test1(rowid, a, b) VALUES(123, 5, 'hello');
  </code></pre>
  
  <p>I got that from <a href="http://www.sqlite.org/autoinc.html" rel="nofollow">http://www.sqlite.org/autoinc.html</a> (Wish I would have seen it two days ago :)) And now I have to go, so I'll post back if this works when I get a chance.</p>
  
  <p>I guess my only concern now (if it works) is does it create empty rows between the ID's you don't use, wasting space?</p>
  
  <p>I've also considered just having two separate lists, but the order is important, so this would require another list to track the order of the objects, so I am wondering if key manipulation is possible.</p>