Pyramid in Sql - Query Examples