code for a simple database