Eh...
SELECT a.*, b.* FROM a CROSS JOIN b;
(SELECT 'a' AS tag, * FROM a) UNION (SELECT 'b' AS tag, * FROM b); SELECT a.*, b.* FROM a CROSS JOIN b;
(SELECT 'a' AS tag, * FROM a) UNION (SELECT 'b' AS tag, * FROM b);Not sure what definition you're using for the category of tables, but I don't think the distinction between table and query is really that significant, at least from a theory point of view. You can declare views and materialized views. In some SQL dialects you can even define triggers which allow you to 'update' them, not that I would have thought mutability would be particularly nice to reason about in a category-theoretic framework.
If you really want to do theory on this stuff, just use the relational algebra, or better yet just plain first-order logic. Much nicer, you have all the products and coproducts you want, and the results can probably be re-applied to SQL with a bit of cludge-work :)