Useful SQL queries for PostgreSQL, in a single database schema.