Skip to content

Instantly share code, notes, and snippets.

@dieissonmartins
Created August 16, 2023 12:51
Show Gist options
  • Save dieissonmartins/a4aad6e4afd073d36a9e0a865f3eb1e0 to your computer and use it in GitHub Desktop.
Save dieissonmartins/a4aad6e4afd073d36a9e0a865f3eb1e0 to your computer and use it in GitHub Desktop.
import sqlalchemy
# Create a connection to the sales database
db_engine = sqlalchemy.create_engine("postgresql+psycopg2://repl:password@localhost:5432/sales")
# Query all rows and columns of the sales table
raw_sales_data = pd.read_sql("SELECT * FROM sales", db_engine)
print(raw_sales_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment