Both the category of schemas (category of categories), and for each schema S, the category of S-databases, are cartesian closed. That means that schemas and S-databases are some of the alternative semantics you can give to simply typed lambda calculi types and terms! The details are described here: https://categoricaldata.net/fql/haskell.pdf