Updating databse and tables