<jupyter_start><jupyter_text>SQL data into PandasMany companies sensibly store data in central databases. The Structured Query Language SQL gives access to these databases. We can access these databases with Python, Pandas and SQL Alchemy.  How To<jupyter_code>import pandas as pd
import sqlalchemy as sql
conn = sql.create_engine("postgresql://scott:tiger@localhost/test")
df = pd.read_sql_table("sales", conn)
query = "SELECT * FROM sales"
df = pd.read_sql_query(query, conn)
query = """SELECT customers, total_spend from sales
           WHERE YEAR = 2019
           LIMIT 1000
           """
df = pd.read_sql_query(query, conn)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08472012102874432, 'fraction_numerical': 0.012102874432677761, 'mean_word_length': 4.516666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '138648', 'license': 'CC0-1.0', 'n_tokens_mistral': 211, 'n_tokens_neox': 195, 'n_words': 67, 'path': 'notebooks/02 - SQL data into Pandas.ipynb', 'repo_name': 'JesperDramsch/skillshare-data-science', 'size': '661'}