Is there an isomorphism between (subset of) category theory and relational algebra?
Let me articulate the Curry-Howard-Lambek correspondence with a bit of jargon which I'll explain.  Lambek showed that the simply typed lambda calculus with products was the internal language of a cartesian closed category. I'm not going to spell out what a cartesian closed category is, though it isn't difficult, instead what the above statement says is you don't need to know! (Or that you already know, if you know what the simply typed lambda calculus with products is.)  For some type theory/logic to be the internal language/logic of a category means 1) that we can interpret the language into the structure on the category in a way that preserves the structure of the language (in effect a soundness condition), and 2) and "essentially" all the structure arising from cartesian closure can be talked about in terms of this language (a completeness condition).

The relational algebra is equivalent to the tuple or domain relational calculus which is essentially first order logic.  This statement is roughly Codd's theorem, though a similar theorem was proved decades earlier by Tarski for FOL and cylindrical algebras.  There is a bit of a subtlety though.  We want the queries in the relational calculus to be domain independent, which is to say that expanding the domain of possible values doesn't change the results of a query.  An example of a relational calculus query that is not domain independent is $\{ x\mid x = x\}$.  Every relational algebra expression is logically equivalent to a domain independent query in relational calculus.

Putting that aside, the categories whose internal logic (which is essentially a decategorified or proof-irrelevant form of an internal language) are Heyting categories for intuitionistic FOL and Boolean categories for classical FOL.  (The categorified/proof relevant versions are described by hyperdoctrines.  Also very relevant are pretoposes of various sorts.)  Note, that FOL, the relational calculus, and the relational algebra do not support aggregation.  (They also don't support the recursion necessary to represent a Datalog query.)  One approach to GROUP BY and aggregation is to allow relation-valued columns which leads to higher-order logic (HOL) and the nested relational calculus (NRC).  Once we have relation-valued columns, aggregation can be formalized as just another "scalar" operator.

Your examples point to the fact that a monadic meta-language is a decent language for queries.  The paper Monad Comprehensions: A Versatile Representation of Queries (PDF) spells this out well.  A more comprehensive and modern look is Ryan Wisnesky's PhD thesis, A Functional Query Language with Categorical Types (PDF), which is related to David Spivak's work which itself seems rather relevant to any interpretation of your question.  (If you want to go more historical, there was the Kleisli, A Functional Query System.)  In fact, the monadic meta-language is a decent language for queries in the nested relational calculus.  Wisnesky formulates NRC in terms of an elementary topos whose internal language is the Mitchell–Bénabou language which basically looks like an intuitionistic set theory with bounded quantifiers.  For Wisnesky's purpose, he uses a Boolean topos which will instead have a classical logic.  This language is quite a lot more powerful than (core) SQL or Datalog though.  It is worth noting that the category of finite sets forms a (Boolean) topos.