title: Get values from SQL table along with column name as list in Python
body: <p>I have a SQL table like below</p>
  
  <pre><code>----------------------------------
       Key         |    Value
  ----------------------------------
  Ralph Williams      Football
  Michael Tippett     Basketball
  Edward Elgar        Baseball
  Rebecca Clarke      Netball
  Ethel Smyth         Badminton
  </code></pre>
  
  <p>I have used <code>cursor.execute("select top 5 Key, Value from TestTable")</code> and then tried to convert as list  using <code>mylist = list(cursor)</code></p>
  
  <p>But I am getting like<br></p>
  
  <pre><code>[(u'Ralph Williams', u'Football'), (u'Michael Tippett', u'Basketball'), (u'Edward Elgar', u'Baseball'), (u'Rebecca Clarke', u'Netball'), (u'Ethel Smyth', u'Rugby')]
  </code></pre>
  
  <p>But I need this table as list in python like below</p>
  
  <pre><code>[{'Key':'Ralph Williams', 'Value':'Football'}, {'Key':'Michael Tippett', 'Value':'Basketball'}, {'Key':'Edward Elgar', 'Value':'Baseball'}, {'Key':'Rebecca Clarke', 'Value':'Netball'}, {'Key':'Ethel Smyth', 'Value':'Rugby'}]
  </code></pre>
  
  <p>How can I make that?</p>