Corrected case in sql statements