Code for the database