I felt I didn't properly understand the conceptual foundation of SQL until I discovered Ken Iverson's APL.
APL was published late 1962, predominantly conceived not as a computer programming language, but as a shorthand mathematical notation for describing algorithms on the blackboard, which Iverson had developed over preceding years whilst teaching.
Most people with an interest in this topic get at least as far as understanding that SQL can be traced back to Ted Codd's "relational model" of databases, in work first published in 1970.
Personally I've always found most educational accounts of Ted Codd's relational algebra to be an un-general and incomplete explanation of SQL. They don't even do Codd himself much justice, let alone do justice to SQL.
Modern accounts of Codd also continue to employ his fairly awkward notation, which looks even more awkward when crudely typeset on a PowerPoint slideshow (Codd, like Iverson, was working mostly freehand on the blackboard), rather than employing the more modern and keyboard-friendly SQL as the notation to illustrate Codd's concepts.
Indeed, APL was also criticised for many aspects of its infamous and PC-unfriendly notation, if not for its underlying concepts.
Both Iverson and Codd were at IBM in the US during the same era in the 60s and 70s, and although it's unclear to me whether they were ever co-located at the same facility or directly cooperated with one another, they both ultimately became IBM Fellows (Codd just a few years after Iverson) and they were each responsible for some of the most notable IBM technologies, so it seems unlikely that Codd was not influenced by Iverson's thinking.
Anyway, a fundamental point about APL is that it is an array-oriented language. There are arrays of values as a fundamental feature, and operators that manipulate these arrays. The same feature exists in Codd's relational algebra.
And SQL also works in terms of there being arrays of values, array operators which can be composed together, and expressions supplied to certain operators to control their behaviour (which are basically the analogy of "lambda functions" in more recent general-purpose languages).
A crucial thing to note is that the order of evaluation in SQL goes From > Where > Select > Order By
, which is not consistent with how it is visually presented. And there may be other perceived deviations at the periphery of the language.
But yes, a select-clause is the analogy of a map function, the where-clause is the analogy of a filter function. Various join-clauses and the group-by clause are implementations of corresponding relational operators. The having-clause is just a where-clause (filter operator) evaluated after, instead of before, the group-by clause.
It's worth noting that operators like join and group-by, are traceable first to Codd and are well-known only within the context of relational algebra, since they depend on the use of three-valued logic and their usefulness as operators is tightly integrated with the relational model.
But the more general concept of array operators, is explained best by Iverson through his work on APL.