> I think part of the issue is that SQL is not a programming language. You cannot really express algorithms in the normal sense in SQL.
1) You can (namely: PL/SQL). 2) The same situation as in SQL (the query part,
not procedural language) you have in Prolog (though SQL query is not
Turing-complete). It's a different paradigm of working with data, but it's
still a programming language.
> Instead you specify a result and let the db decide the algorithm.
The term you're looking for is declarative programming.
1) You can (namely: PL/SQL). 2) The same situation as in SQL (the query part, not procedural language) you have in Prolog (though SQL query is not Turing-complete). It's a different paradigm of working with data, but it's still a programming language.
> Instead you specify a result and let the db decide the algorithm.
The term you're looking for is declarative programming.