title: How do i insert multiple tables into a table using TinyDB?
body: <p>I have been trying to create multiple tables in a table using TinyDB. Here is a website to help you understand what TinyDb is (<a href="https://media.readthedocs.org/pdf/tinydb/latest/tinydb.pdf" rel="nofollow noreferrer">TinyDB PDF</a>). The PDF file did not show how to insert multiple tables into one, one multiple data into one table. </p>
  
  <p>I intended the json file to look like this:</p>
  
  <pre><code>"MASTER TABLE": 
  {
       {"TABLE 1": {"1": {"Name": "Alice", "Age": 19}}
       {"TABLE 2": {"1": {"Name": "John", "Age": 12}}, 
  }
  </code></pre>
  
  <p>However, the issue is that I'm not sure how to insert Table1 and Table2 into the Master file table. SO it gave me the error that table1 is not an element. I know it isn't an element but I don't have any idea of how to fix it, to put the two tables under the Master file table. I'd appreciate any help.</p>
  
  <p>Here's my codes:</p>
  
  <pre><code>from tinydb import TinyDB, Query
  from tinydb import TinyDB, where
  import json
  
  with open("/home/pi/Desktop/jsontest/test.json", 'w+'):
      table1 = TinyDB('/home/pi/Desktop/jsontest/test.json')
      table1 = table1.table('TABLE 1')
      table1.insert_multiple([{'Name' : 'Alice' , 'Age' : 19}])
  
      table2 = TinyDB('/home/pi/Desktop/jsontest/test.json')
      table2 = table2.table('TABLE 2')
      table2.insert_multiple([{'Name' : 'john' , 'Age' : 12}])
  
      overall = TinyDB('/home/pi/Desktop/jsontest/test.json')
      overall = overall.table('MASTER TABLE')
      overall.insert([table1])
  </code></pre>