title: inserting to database from query in python
body: <p>I have a table of tweet data <em>my_tweets</em> containing these columns: <em>tweet_id</em>, <em>text</em>, <em>created_at</em>, <em>sentiment</em></p>
  <p>My tweet data is being streamed live and simultaneously inserted into the table.
  I am writing code using Vader to get the sentiment of the text.
  At the moment, <em>tweet_id</em>, <em>text</em>, and <em>created_at</em> are all populated.</p>
  <p>I would like to use this query: <code>SELECT * FROM my_tweets WHERE sentiment is null</code> in MySQL to get rows where <em>sentiment</em> is null and insert the sentiment from Vader.</p>
  <p>Any suggestions on how I can go about this?</p>
  <p>My program currently looks like this:</p>
  <pre><code>getTweetSentiment():
     #my code
     return score
  
  addSentimentToDatabase():
     try:
        con = mysql.connector.connect(host = h, database = db, user = un, password = pw)
        query = (&quot;SELECT * FROM my_tweets WHERE sentiment is null&quot;)
        #need to insert sentiment based on what the query returns
     except error as e:
        print(e)
     
  </code></pre>