Database Handling code for group project