title: SQLAlchemy - simple select statement
body: <p><strong>Background:</strong></p>
  
  <p>I am very new to SQLAlchemy and it seems to be fairly confusing as to how I should be selecting things.</p>
  
  <p>I have a table in my mysql database which is called genes, where I have gene_id, gene_description, and gene_symbol</p>
  
  <p><strong>What I want to do:</strong></p>
  
  <p>All I want to do is a simple select query:</p>
  
  <pre><code>Select * from Genes
  </code></pre>
  
  <p>But I seem to be confused as to how we shall achieve this</p>
  
  <p><strong>Here is what I have done:</strong></p>
  
  <pre><code>import sqlalchemy
  from sqlalchemy.orm import sessionmaker
  from sqlalchemy.ext.automap import automap_base
  import csv
  import pandas as pd
  
  engine = sqlalchemy.create_engine('mysql://root:toor@localhost') # connect to server
  metadata = sqlalchemy.MetaData(bind=engine)
  engine.execute("USE TestDB")
  
  genes = sqlalchemy.table('Genes')
  s = sqlalchemy.select([genes])
  engine.execute(s)
  </code></pre>
  
  <p><strong>The problem:</strong></p>
  
  <pre><code>ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `Genes`' at line 2") [SQL: u'SELECT  \nFROM `Genes`']
  </code></pre>
  
  <p>Also is there some type of "intellisense" where I can just do something like gene_table = engine.Gene. If I am not mistake there is a way to do this with mapping but it didn't work for me</p>
  
  <p>EDIT:
  This may help: </p>
  
  <p><a href="https://stackoverflow.com/questions/6290162/how-to-automatically-reflect-database-to-sqlalchemy-declarative">How to automatically reflect database to sqlalchemy declarative?</a></p>