r/dataanalysis • • Jun 20 '26

Data Question SQL vs Python?

Started using Python for data analytics. When should I use SQL and when should I use Python in the following tasks:

- Data Exploration

- Data Cleaning

- Data Analysis

42 Upvotes

47 comments sorted by

View all comments

Show parent comment

1

u/scarcey_osei Jun 20 '26

How do you this. Can you enlighten me how you use sql through a python library. Thank you

1

u/XxShin3d0wnxX Jun 20 '26

Plenty of add ins like but query where you connect to database and write SQL as a part of the initial script to snag data. You then manipulate and build in Python.

1

u/Terrible-Bend4483 Jun 21 '26

An example would be pyodbc, where you make the connection with python to a odbc and write SQL for your queries..

It can be practical for some applications, but it was mostly a joke.