updated sql statements to reflect the db