title: Using Python: how to get table names from sql query and add a word before the table schema where schemas are present
body: <p>I have a json file that I am using as a dictionary in Python. The json file is very large. I am trying to write a python code to update each "query" by adding a "source." before the table schema. then use the updated dictionary for other programming purposes. </p>
  
  <p>The SQL scripts could have joins, cartesian joins, subqueries, etc.</p>
  
  <p>Expected output: </p>
  
  <pre><code> "query": "SELECT a.column1, b.column2
   FROM source.abcd.hist a, source.efgh.present b
   WHERE (select column3, column4 from UPS where a.id = b.id )"
  
   "query": "SELECT a.column1, b.column2
   FROM source.apple.hist a, source.mango.present b
   WHERE (select column3, column4 from source.my.ORANGE where a.id = b.id
  
  {"result":[{
  "query": "SELECT a.column1, b.column2
  FROM abcd.hist a, efgh.present b
  WHERE (select column3, column4 from UPS where a.id = b.id )"
  },
  {"query": "SELECT a.column1, b.column2
  FROM apple.hist a, mango.present b
  WHERE (select column3, column4 from my.ORANGE where a.id = b.id )"}
  ]}
  </code></pre>