Creating some database access functions.