Fix schema misstep in SQL code with correct syntax