I can't count the number of times I've thought "this would be so much easier in python!" as I write SQL queries. Tc:78k (yes I know it's low) Yoe: 4
The first things u learn is always intuitive than the things that come later in life
OP, are you a data analyst in Bay Area?
Sure am!
TC seems low for Bay Area. Year of experience?
it is because you have all the data in memory using pandas dataframe. SQL is not just select statement, it is way more than that.
SQL can do a lot more with a small query than post processing data with python. Also less logic means less bugs. I'll always use queries when I can.
Yeah that's a good point. I guess I just need to practice more. It's hard to find really in depth sql questions though!
If you don’t know how to use sql, sure.
Python is an awesome language. It is definelty easy to learn and more powerful than many oldschools' argue.. SQL is powerful but knowing just sql will not keep you on the run. I know many ppl who knows only SQL suffer in Job market. There is a prediction that states AI will code Python in few years, I bet AI can do SQL queries well ahead of this. All the best.
For the things that were easy in SQL, are you thinking 'this would be so much harder in Python?'.
They really are for different purposes. Tons of things are really easy in SQL but difficult in Python, yet others are the other way around. It's true that Python's list/dict comprehensions sort of give you some SQL-like features so there's significant overlap, but Python can only really do that trick with data in memory, and there's still stuff that's not as convenient or easy as in SQL. Also, having worked extensively with both, I have to say it's VEEEEEERY common for SQL-focused jobs to be done by shitty developers who don't know the first thing about writing decent, maintainable code. To be fair, SQL's design actively disincentivizes modularity in various ways, and more so for shitty implementations or if you need to stick to features supported cross-engine. The result is that even though SQL is pretty powerful (especially in good engines), most SQL code out there is absolute garbage and a pain in the ass to work with. Python is more geared towards general developers who usually care more about writing decent code, and Python's design and culture are particularly (over-)prescriptive and force a lot of uniformity on how you structure your code. That makes it easier even if it's often limiting and inconvenient. I would encourage you to review some of the more advanced SQL features in a good featureful engine. PostgreSQL is about as good as it gets, and has many tricks up its sleeves: JSON manipulation, several special types of indexes and the ability to define them on subsets of your data or expressions computed from them, recursive CTEs, window functions, lateral joins, rollup/cube, granular control for concurrency, various modes for cross-transaction visibility control, sampling-based queries…
Doesn’t everyone think that?
Oh ha. For some reason I got the idea that SQL was looked down on as a "easy" with people calling analysts "SELECT * monkies"
Lol, people who do that are idiots...SQL is a full programming language with recursion and all. If you want to ruin your life, that is.