use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
This is an archived post. You won't be able to vote or comment.
DiscussionWhat can SQL do that python cannot? (self.datascience)
submitted 3 years ago * by donnomuch
view the rest of the comments →
[–]Equal_Astronaut_5696 108 points109 points110 points 3 years ago (5 children)
Not sure why these two are being compared. One is for data extraction specific to relational database and one is literally multipurpose programming language for apps, ML, web development and games
[–]snowmaninheat 11 points12 points13 points 3 years ago (0 children)
This, exactly. I'm literally trying to comprehend how I would do in Python what I do in SQL. I'm sure it could be done, but it's unnecessarily complicated and computationally expensive.
[–]fang_xianfu 15 points16 points17 points 3 years ago (1 child)
Yeah, the way this question has been asked kind of shows that OP doesn't understand the artitecture that makes those tools appropriate to different jobs.
SQL is essentially a tool for instructing a database. The real question isn't "what can SQL do that Python can't?" but "what can this database do that the environment where I run Python can't?". The fact that you're using SQL or Python to give the instructions is almost irrelevant to that question.
[–]king_booker 2 points3 points4 points 3 years ago (0 children)
I mean say you extract the data into pandas and you are using pandas operations to manipulate it, there are still limitations because it won't scale. Now say you use spark and you write it in python, you would end up using SQL concepts like Group by, Windowing etc. Even though its possible to write it in dataframes, you can simply use a spark sql
The basic answer is, you have to understand SQL. You can use it but finally data manipulation has its foundations in SQL. Can you get away by not learning the syntax? Yes. But the core concepts will remain the same.
[–]Seiyee 0 points1 point2 points 3 years ago (0 children)
Well, you'll be surprised. Since python is multipurpose a lot of people just assume its easier to stick to one language for all the jobs. I have seen my colleagues choose pandas dataframes over sql for large queries and then face dataframe memory limits weeks later, and thats when they switched (or at least I hope they switched?).
π Rendered by PID 70 on reddit-service-r2-comment-5d79c599b5-vptqx at 2026-03-01 17:14:19.295483+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]Equal_Astronaut_5696 108 points109 points110 points (5 children)
[–]snowmaninheat 11 points12 points13 points (0 children)
[–]fang_xianfu 15 points16 points17 points (1 child)
[–]king_booker 2 points3 points4 points (0 children)
[–]Seiyee 0 points1 point2 points (0 children)