A "case" statement in SQL (or an "iif") is still declarative, how else would you express specific cases when necessary?
A "case" statement in SQL (or an "iif") is still declarative, how else would you express specific cases when necessary?
iif and case by itself is not declarative or imperative. only an entire language can be described as such
Imperative programming: really detailed cooking recipe
Functional programming: assembly line of a car factory
Declarative programming: a robot what can do what is programmed for, and sometimes can work with really unspecific instructions (like this one line in a file "Hello world" is not a valid HTML, but the browser still renders it)
"functional programming, but that doesn't change the fact that SQL is a declarative language for describing recordsets"
ok, im describing recordsets for you: this set has 4223 records. I'm thinking of something else, but i can't really describe a recordset with anything else. Describing is not what you do when you create a software. You have a problem and you literally write a solution like an author write a book. And as you said, with SQL, you use a functional approach, how you do it when you use lambda or LINQ. Therefore SQL is functional.
SQL is turing complete with the structured extensions, so in that way can be general purpose, but something is general purpose or not does not decide the paradigm. Usually languages are more restrictive moving to the declarative side of things, but that is by design. The point is that you write less text.