Actually, I ran the code and the last SELECT statement returns 3 rows. How did you get 1 row?
Actually, the goal should be to read and think.
That being said, I am confused with how do we know when the question with an error in the script has a typo and when is it intentional?
In reading the question, I see an error in the code. Seeing no error for an answer, I decide (incorrectly) that this must be a typo. So I mentally correct the code and continue on. With the correction to what appears to be a typo, I see that the answer has to be one of the answers shown. After selecting it, I am told that I am wrong. I then run the script to learn something new to find that there isn't anything new. Just confusion. If that is the goal, then the QoD was successful.
Right. Perhaps you responded before seeing my later reply.
As I mentioned in my reply to another commenter, I never run the code before answering the question. Otherwise I would have a much better QOTD score! I agree with you that the goal should be to read and think. However, above I was specifically replying to another commenter who said that no matter what, the result was 1 row. So, I ran the code - after I had already answered the question and gotten it wrong, just to be clear. And I see 3 rows. So I was asking how the commenter got 1 row.
I share your uncertainty about mentally correcting code, especially because there was no error as a choice (there couldn't be or else the trick would be revealed), but unfortunately in my case I missed concentrating on the syntax error even though for a moment I saw that there was something odd about the constraint definition. So reading carefully would not have helped me - it was a blind spot because I wasn't confident in my knowledge. So the "something new" for me was that I need to know my syntax better.
But as Hugo stated, the documented instances of unintentional typos may have thrown off people who did spot the syntax error, leading them to mentally correct the error when they shouldn't have. I think the only way to avoid that problem is to avoid any mental corrections and just take the code at face value.
For those who were confident that the constraint definition syntax was wrong, then I don't see mentally correcting it as the right way to proceed. Just assume the error happens and extrapolate what happens next. That would get you the right answer, regardless of the author's intentions. The only feasible proposed solution I have seen was by another commenter who suggests setting the question category to Syntax and using a screenshot of the code to discourage copy and run responses. But in its own way, that solution involves relinquishing the trick question aspect - which is fine by me, but I think not fine with those who like trick questions.