SQL Column types in Jupyter Notebook
<p>so I recently started using Jupyter Notebook.</p>

<p>I use SQL queries and then import my results as dataframes to pandas. 
However, having tried everything I could find on the internet, I am not able to get the type of my table columns using SQL.</p>

<p>I can get the types once imported to pandas using 'type()' but that's a different format than the one used in the database.</p>

<p>Is there a way to directly get it from the database using SQL queries, or do I have to convert it from pandas type ?  </p>

<p>Easiest way to get column type from a SQL query is:</p>

<pre><code>SELECT DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
    TABLE_NAME = 'tableName' AND
    COLUMN_NAME = 'columnName'
</code></pre>

python sql pandas apache-spark-sql jupyter-notebook