Attempt at the database Code.