title: Using Jupyter notebook to convert SQL into Panda Data Frame
body: <p>I'm trying to fetch SQL Query to Pandas Data Frame using Jupyter Notebook. </p>
  
  <p><strong>I followed <a href="https://stackoverflow.com/a/14487936/8305056">these instruction from beardc</a>:</strong></p>
  
  <pre><code>import pandas as pd
  
  df = pd.read_sql(sql, cnxn)
  
  cnxn = pyodbc.connect(connection_info) 
  cursor = cnxn.cursor()
  sql = """SELECT * FROM AdventureWorks2012.Person.Address 
  WHERE City = 'Bothell' 
  ORDER BY AddressID ASC"""
  df = psql.frame_query(sql, cnxn)
  cnxn.close()
  </code></pre>
  
  <p><strong>However, whenever I run the code it shows:</strong></p>
  
  <pre><code>NameError                                 
  Traceback (most recent call last)
  &lt;ipython-input-5-4ea4efb152fe&gt; in &lt;module&gt;()
    1 import pandas as pd
    2 
    3 df = pd.read_sql(sql, cnxn)
    4 
    5 cnxn = pyodbc.connect(connection_info)
  
  NameError: name 'sql' is not defined
  </code></pre>
  
  <p>I'm using a monitored-network (company network if anyone asks). </p>
  
  <p><strong>There are some questions I want to ask:</strong></p>
  
  <ol>
  <li>Do I have to change the <code>connection_info</code> into the info in my database?</li>
  <li>Is it important that I'm connected to a network that might have restriction on port connection? as the company sets up some of those.</li>
  </ol>
  
  <p>I'm using the latest Anaconda Distribution.</p>