title: What data structure does a SQL query return in python?
body: <p>I would like to calculate the 'totalStock' but I am getting a typeError because p['stockValue'] is not an integer. I have tried to use the int() function but it also does not work.</p>
  <pre><code>    def index():
      # Get user ID
      user_ID = session['user_id']
  
      # Query for symbol, name, shares and store in variable
      purchaseData = db.execute('SELECT symbol, name, shares FROM purchases WHERE id = :id', id=user_ID)
  
      #Store all info in userData
      userData = {}
      stockCount = 0
      for i in purchaseData:
          userData['symbol'] = i['symbol']
          userData['name'] = i['name']
          userData['shares'] = i['shares']
          userData['price'] = lookup(i['symbol'])
          # Calculate stock value
          userData['stockValue'] = lookup(i['symbol']) * i['shares']
          # Count rows
          stockCount += 1
  
      # Query for remaining cash
      userData['remainingCash'] = db.execute('SELECT cash FROM users WHERE id = :id', id=user_ID)
  
      # Calculate total value
      totalStock = 0
      for p in userData:
          totalStock = totalStock + int(p['stockValue'])
  
      userData['totalValue'] = userData['remainingCash'] + totalStock
  
      # Return render and send values
      return render_template('index.html', rows=stockCount, **userData)
  </code></pre>
  <p>What is the structure of purchaseData?</p>