Updating SQL

Changing SQL to match MySQL standards (previously in Oracle SQL, which
is different)