exercise 3-4: simple database