in reply to
Re^3: OT: Mathematics for programming (again)
in thread OT: Mathematics for programming (again)
More specifically, any language that has goto, conditional jumps, or continuations can be used to implement loops if they don't have native loops. Any language which can build and walk a tree or list can be used to implement a loop, too. Any language in which one can attach arbitrary actions to an iterator has a basic looping construct. Any language that can both increment or decrement an integer value and evaluate data as code can be used to implement loops.
Things equivalent to loops in one situation or another include recursion, vector operators, iterators, and repetition operators. Tail recursion or mutual recursion between two subroutines can be converted into a looping construct. Vector operators are made up of loops unless they are using special explicitly parallel hardware. Iterators can both be the basis of a loop and can be implemented using a loop or some loop equivalent. Repetition operators are usually implemented as loops, but could be implemented using recursion, conditional jumps, lists, set manipulations, vector ops, or continuations. Any language in which you can construct, transform, and test arbitrary sets in arbitrary ways can be used as an equivalent to loops, too.
SQL is a declarative set specification and transformation language. Where the loops in SQL are is obvious if you look at the issue sideways: they are implicit. SELECT, UPDATE, and DELETE are vector operators and WHERE confines the members of the vector to some subset of the master set. INSERT is a vector operator which adds to the master set. Each SQL statement (barring special functions) is a subset specification, set growth or shrinkage operation, or transformation on (sub)set members. There generally is an iterative or recursive program in charge of getting you the proper results for your requested set. You're just not writing it. It's the product of translation and happens inside the database software's planning and execution engines. Still, since SQL can store, transform, and test arbitrary sets in arbitrary ways, it can be used equivalently to a language with explicit loops in regards to those sets.