Python Before SQL? Sure!

Shivam Anand
2 min readDec 30, 2021

Learn the BaSics before Python’s fancy!

But.. there’s no harm in going from pandas to SQL. In fact, it could make learning SQL a breeze..

Consider Sales data :-

where each row is a sale

You want to find what how much money your favourites C & D earned.

How do you think about this?

You go to the ledger with the sales data, you focus on C & D and just sum up their Sales.

Easy left to right flow readability, but does it translate the same in our SQL syntax?

Not quite..

SQL syntax

The literal & actual execution don’t follow the same order, thus making readability for beginners ludicrously hard.

Now compare it to how it flows left to right in Python.

The same order of arranging the jenga blocks is also order of the execution.

Do this then do but then also do that

reads much better than…

do that after doing this but before everything, do that

On Python, reinforce the logic via 100s of queries such that the order is instilled.

When you traverse SQL waters, you’ll instinctively know the actual order that’s being executed despite what it literally looks like. Complex SQL structures won’t seem daunting at all.

Happy Sailing through Data!

--

--

Shivam Anand

I love building data products. Sharing what i wish i knew!