homework using postgresql