Comment by randomNumber7
2 days ago
Also SQL is not turing complete. I see it more as a descriptive language like e.g. html is a language but not a programming language.
2 days ago
Also SQL is not turing complete. I see it more as a descriptive language like e.g. html is a language but not a programming language.
This is completely wrong. The SQL spec isn't Turning complete but multiple DBs provide Turing complete extensions (like pgplsql) that make it so. Also, even without the extensions, it is still very much a programming language by any definition of the term. Like most takes on SQL, it is more about your understanding (or lack thereof) of SQL.
I was under the impression that recursive CTEs make the SQL spec Turing complete. Not that it makes any practical difference, it's still very difficult to use for "general purpose" programming, and still very practical to use for data processing / management.
Last year I read about some database researcher who implemented AoC in pretty standard SQL.
If the spec isn't Turing complete, only individual extensions to the spec, I think it's correct to say "SQL isn't Turing complete".
It can do loops and recursion. It can use as much memory as it is allowed. It can do general programming via functions and stored procedures.
It can't do loops. Unless you're talking about extensions to SQL such as PL/SQL and T-SQL.
It can do loops. Recursive CTEs has been in the standard since SQL:1999
https://en.wikipedia.org/wiki/SQL:1999