Connect to Any SQL Server in 60 seconds with SQL Alchemy!!

Published: 27 November 2022
on channel: Data Science with Josh
44,522
1.3k

This is how to connect to any sql server in less than 60 seconds using the SQL Alchemy python library.

Source code:
Libraries
import pandas as pd
import sqlalchemy
from sqlalchemy import create_engine

Creating SQL Alchemy engine object
engine = create_engine('postgresql://postgres:youtube@localhost:5432/eSports.val')

Initiailizing connection to database
conn = engine.connect()

SQL query as a string to pass into pd.read_sql function
sql = "SELECT * FROM players"

Creating dataframe using sql statement and db connection
df = pd.read_sql_query(sql,conn)


On this page of the site you can watch the video online Connect to Any SQL Server in 60 seconds with SQL Alchemy!! with a duration of hours minute second in good quality, which was uploaded by the user Data Science with Josh 27 November 2022, share the link with friends and acquaintances, this video has already been watched 44,522 times on youtube and it was liked by 1.3 thousand viewers. Enjoy your viewing!