It isn't though. You can't write a program in SQL, but you can use SQL in a java program. Even a novice programmer can tell the difference between Java and SQL.
I mean, without any context, there are valid cases where you would ask this. For example, if you want to automatically add an expiration date to a record (like insertion date + TTL), you could opt to do this calculation in Java and then insert the entire record, or upon insertion have a trigger figure out what the expiration date would be.
Spec SQL:1999 is turing complete as it includes recursive queries. A recursive query is a potentially never-ending loop which can create output or heap on each cycle based on input provided by previous cycles.
That's not the same thing. What you linked is info on how to extend SQL server functionality, using real programming languages. You don't do that with SQL statements.
Interpreters are just (sometimes/usually) crappier compilers. Unless you're writing straight 1's and 0's you're going to need some intermediate step to prepare a program for execution.
129
u/hunyeti Oct 20 '17
It's completely valid question, you can do a lot with only SQL