The PL/SQL Challenge (www.plsqlchallenge.com) offers a daily quiz on the PL/SQL language, through which thousands of Oracle technologists demonstrate and deepen their knowledge of PL/SQL. This blog contains posts by the PL/SQL Challenge founder, Steven Feuerstein, as well as comments from players.

12 November 2010

Numbers are names, too! A mistake in the 11 November quiz (1644)

The 11 November quiz contained a mistake, due mostly to incomplete "specifications" in the question text. The question stated that I created a table like this:

and then ran a block at 2 AM each morning that worked with data from this table. I scored as correct the following choice:
"Oracle will raise a NO_DATA_FOUND exception if all the employee last names have no more than 10 characters."
and my explanation for this choice stated:
"If I manage to populate the collection with rows from my table, then Oracle will certainly raise NO_DATA_FOUND when it tries to execute the numeric FOR loop. This is so because the index values are strings and not integers, so there is no possible way that the collection is sequentially filled from index value 1. As a result, this code will raise a NO_DATA_FOUND exception - unless the employees table is empty."
Well....many, MANY players had a field day with this choice. They were especially entertained by my "no possible way" phrase. You see, I never stated any rules about an employee name. Consequently, the names in the table could all be integers (1, 2, 3, etc.) and in this case, the block would not raise NO_DATA_FOUND.
And, even more sadly, this mistake affected TWO of the choices for the very same reason. The choice "I will see the employee IDs for every row in the employees table." could be true if all employee last names were integer values starting with "1" and proceeding sequentially to the number of employees in the table (1,2,3...).
Silly me - and very sharp of so many players for noticing this gap in my specifications and therefore the possible behaviors of my code.
I am, once again, impressed at the close attention paid by so many PL/SQL Challenge players to these quizzes. Assuming you pay the same amount of attention to your application code, I am certain those applications are of the highest quality!
I will give everyone credit for both these choices, and change the question text so that it is clear that names contain characters.
From all those who notified me of my mistake, Oleg Gorskin was selected randomly to win an O'Reilly Media ebook. Congrats, Oleg!
Any other comments/objections to this quiz?
Cheers, SF

Too many subjunctive mood ...And choices has no adverbs which can affect possibility.

So in general choices could look like:"[If GIVEN_CONDITION then] it's possible that SOMETHING could occur"

1) If table is empty then it's possible that row will be inserted into log.It's correct. It's always correct in given conditions.

2) If all length(name)<=10 then it's possible that NO_DATA_FOUND will be raisedIt's correct. It's as a rule correct in given conditions. Because of name as a rule doesn't consist of only digit(s).

3) If any length(name) > 10 then it's possible that VALUE_ERROR will be raisedIt's correct. It's always correct in given conditions.

4) It's possible that all rows will be shown.It's correct. It's occasionally can be correct in given conditions (no conditions in this case). Because of set of all names can correspond to set of unique consecutive numbers starting from 1 and no exceptions will be raised. It's nonsense in life but it's valid sample data.

So all choices should be marked as correct.But (as I can see your intention) 2-nd and 4-th choices shouldtest/demonstrate misuse of integer loop (and index) withassociative arrays indexed by string. And following this intention4-th choice should be marked as incorrect.

I've read CHANGED quiz.My point is: I completly disagree with rescoring of NO_DATA_FOUND. In original wording it must be marked as correct without any credits.Could NO_DATA_FOUND occur? - Yes, it could.

I *think* I understand your point, Vitaliy. There was a scenario under which NO_DATA_FOUND would have been raised, yes. I could have left the scoring as is. But I generally rescore when the intention of my quiz was contradicted by the ambiguity or mistake. That is the case here.

Quiz does not ask us "yes or no". It ask literally "Which of the choices describe possible scenarios that could occur?"So yes, NO_DATA_FOUND could occur regardless of must name contain at least one letter or not.

I see your point now. Sorry, I did not realise before that you were talking about the question. I thought you were talking about the choice wording.

Yes, the question wording wasn't very good. I agree with you that each choice could be marked as correct as the question asks if the scenario could occur. And scenario for each choice could really occur.

And I have cleaned up question and choice text so that I now believe that the choice marked incorrect CANNOT BE CORRECT. Please review and if you disagree, specify a scenario for which that would be the case.

But it is also not the quiz I've taken.New wording obviously would cause me (and everyone) to spendDIFFERENT amount of time on the quiz. For example, much faster.But my quiz percentile is still reasonably badthough I've originally made right decisions.

Steven, don't you think that in case of your mistake/ambiguityyou should forgive not only choices but also the time(taking into account only unchanged choices)?Doing so you won't penalize those whom your mistakelead to long time resolving of ambiguity.

Yes, Vitaliy, I think that is a legitimate point, but I am not sure how I would do it. Give everyone the same time? What time would that be? The lowest time recorded? But what if that is 10 seconds? Then that could harm someone later when I do the "too fast" adjustments.

Better I think to just "let it go" - you got credit for a correct choice, and it is just one quiz among many...