Debug a SQL query that is failing to run due to syntax errors, and then optimize it to run more efficiently on a large dataset.
You are practicing as a guest. Sign up free to get your answer graded with AI feedback. Your draft stays right here.