SQL vs Pandas

Thanga Sami
2 min readJun 7, 2021

SQL and Pandas are two database handling methods playing a vital role in the Datascience world. In this article, The Syntax comparisons between the two are given. The dataset we used for this experiment is available in below Github location.

https://github.com/Thangasami/BMI-Table

Two CSV data files (BMI & FIT) are used for this analysis. Respective definition details are given below.

Select & Basic Data Fetching commands are compared below.

Advance Data Manipulation commands like Group by, Order By, etc given below.

JOIN

In Pandas, “Concat” function is used to join two different data frames. it will be very useful for inner and full outer join scenarios.

Merge Function is the best to suit for Left and Right outer join scenarios. Pandas provides an “indicator” parameter that can be used with the merge function which creates an additional column called “_merge” in the output that labels the original source for each row. _merge column is used to identify whether join data is present in both table or available in left table/right table alone.

Somemore DML Commands for comparision.

Frequently Used commands in Pandas

--

--

Thanga Sami

I am a data science and machine learning enthusiast with hands on experience in python. I have graduated from MIT Chennai with 13+ years IT Experience