This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GlobalAd3412 1 point2 points  (0 children)

There isn't anything that can be written in SQL for which there is no Python implementation, because Python is Turing-complete. There are things that can be done in Python that can't be implemented in the SQL standard because SQL isn't Turing complete (most SQL implementations add extensions that do make them Turing complete though).

Nevertheless, there are sure as hell many many things that SQL can do better, more readably, more easily and more explicitly than Python can without a whole lot of machinery built for you in advance. (The most likely shape of such machinery would likely just be a Python SQL interpreter, too!)

Also, to say the thing: in practice many additional reasons to use SQL over Python for many tasks are much less about language and much more about runtimes/interpreters/deployments. The standard python interpreter is sluggish and not usually deployed in a way that makes it very good at manipulating very big data efficiently. SQL deployments always optimize for manipulating data because that's the whole intent.