title: Extract parameters like table name, columns etc. from sql string
body: <p>I need to extract parameters like table names, selected columns and WHERE-statements for a given SQL string in Python 3. Is there a a library, that can do this and could I get an example for my case?
  Something like:</p>
  
  <pre><code>sql = 'select cola, colb, colc from "someschema"."mytable" where id = 1'
  result = sqlparse(sql)
  print(result.columns)
  &gt;&gt; ["cola","colb","colc"]
  
  print(result.tables)
  &gt;&gt; ["mytable"]
  </code></pre>
  
  <p>If the question is not clear: The same question was asked before for C#
  <a href="https://stackoverflow.com/questions/40479872/extract-column-names-and-table-name-from-any-sql-query-string">extract column names and table name from any &quot;SQL query&quot; String</a></p>