Updated with the new database. Please add back the missing tables and ammend your codes if needed.