updated sql statements.