June 23, 2008 at 2:56 am
I selected option 2 (and only option 2) and was told I was wrong, as I needed to select option 2 & 3. However option 3 returns the results in the following order:
EmpName DateOfLeaving
dcd2000-08-10 00:00:00.000
abc1999-10-10 00:00:00.000
bcd1998-11-11 00:00:00.000
ccdNULL
eedNULL
and the question stated that the solution should be:
EmpName DateOfLeaving
Bcd 11 Nov 1998
Abc 10 Oct 1999
Dcd 10 Aug 2000
Ccd null
Eed null
Therefore I guess thtat the question is worng. At least I should get a point for writing this reply! 😛
Regards,
Phil
June 23, 2008 at 3:02 am
Glad to see I'm not alone in deciding immediately that answer #3 with DateOfLeaving DESC wouldn't put the dates in the right order so is definitely wrong, irrespective of where the NULLs come!
Derek
June 23, 2008 at 3:12 am
Only option 2 gives result as shown in the question, but reading back the question, I get really confused if that even was what was asked.
The question is to have list off all employees with the employees with DateOfLeaving coming last
Doesn't this mean that employees without DateOfLeaving (the null values), should be first in the result set?!
Guess the only good solution is to give everybody their points 😀
June 23, 2008 at 3:24 am
The question is to have list off all employees with the employees with DateOfLeaving coming last and all others sorted ascending order of date of leaving
Maybe he wanted to say this?
The question is to have list off all employees with the employees without DateOfLeaving coming last and all others sorted ascending order of date of leaving
Anyway the two answers which they say being correct have different results, so at least one of them is wrong... #3 in my opinion is wrong and I was very surprised of it when I was told that #2 alone was not correct 😉
June 23, 2008 at 3:46 am
Another controversial question, where you tend to lose points though u know the answer....
June 23, 2008 at 3:46 am
Another controversial question, where you tend to lose points though u know the answer....
June 23, 2008 at 4:21 am
...Or a badly written question with the wrong answer supplied:(
June 23, 2008 at 4:23 am
Sorry - you were wrong
I was already afraid of that, seeing how the text of the question and the sample output presented contradict each other.
Really a shame. It is a very good use of the QotD to remind people of how NULLs behave in an ORDER BY, but those good intention are thwarted by poor checking of the correctness of the question and the answers.
Tell me - is it really too much trouble to go ahead, create a table and actually (gasp!) RUN the queries before submitting the QotD to the contribution center?
(Edit - hmmm, seems the color tag doesn't work. Bummer)
June 23, 2008 at 4:51 am
According to the question as specified, the only correct answer is number 2, sorting by date desc cannot give the required result regardless of null values.
June 23, 2008 at 4:55 am
I to got the question "wrong". What I want to know is, when someone puts up a QoD, is there any sort of checking involved by the mods/admins, or is it just like posting in the forum, you put it up and its live. If its the later then I really think that the whole posting a QoD process should be changed so that someone can double check the answers for that QoD so that questions with the wrong answers don't appear. To me, it sort of makes the site look unprofessional with incorrect answers appearing for the questions.
June 23, 2008 at 5:26 am
There is only 1 correct answer, and that's the 2nd. The desc, asc answer will NOT list the employees as shown.
June 23, 2008 at 5:46 am
Looks like I'm not alone in thinking we need some kind of editorial review over these Q&As, eh? I know English isn't everyone's first language, so I don't mean to be insulting, but a bit of proofreading just to make sure the question is intelligible would be a good thing.
Oh, and it would help if the correct answer was actually correct. Kinda defeats the purpose otherwise.
-----
a haiku...
NULL is not zero
NULL is not an empty string
NULL is the unknown
June 23, 2008 at 6:05 am
I also chose the correct answer #2. Please give us our points back:angry::angry::angry:
June 23, 2008 at 6:29 am
I was a bit hesitant to answer this one as I noticed there were checkboxes instead of radio buttons, and I thought to myself, "Hmmm... there's only one right answer, but it looks like they're expecting me to pick more than one." *sigh* I agree with the above posters that there definitely should have been some sort of proofreading on this one.
Viewing 15 posts - 16 through 30 (of 138 total)
You must be logged in to reply to this topic. Login to reply