Fixed syntax errors in SQL.