Updated the SQL