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:
CREATE TABLE plch_employees (
  employee_id INTEGER,
  last_name VARCHAR2(100)
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


  1. This just in...

    John 43718 retired today. He was the only employee with the last name of 43718 and Carl 43719 said he will miss working with him.


  2. Repost.
    The different choice requires rescoring:

    > Which describe possible scenarios that could occur

    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 raised
    It'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 raised
    It'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 should
    test/demonstrate misuse of integer loop (and index) with
    associative arrays indexed by string. And following this intention
    4-th choice should be marked as incorrect.

  3. 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.

  4. Those who think that NO_DATA_FOUND couldn't occur are wrong regardless of quiz wording.

  5. 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.

  6. > But I generally rescore when the intention of my quiz was contradicted by the ambiguity or mistake.

    Could someone explain me what kind of mistake and in which way can make players to respond to question "Is NO_DATA_FOUND possible?" differently from Steven's intention?

  7. Vitaliy

    Original wording: "Oracle will raise a
    NO_DATA_FOUND exception if all the employee last names have no more than 10 characters."

    It is true in one case (values in last_name column contain letters) but it is also incorrect in another case (valus in last_name column contain only numbers in sequential order starting with '1').

    Is it yes or no?



  8. domi said: "Is it yes or no?"

    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.

  9. Vitaliy

    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.


  10. 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.

    Thanks, SF

  11. Steven

    I'm almost 93% sure that when I looked at the question last Saturday it still said "could".

    I have just quickly looked at it now and it seems to be bullet-proof now :)


  12. Now there is consistency among question, choices and correctness.

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

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

  13. 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...