October 28, 2015 at 2:53 am
radek.hruby (10/28/2015)
The author possibly overlooked that in the first sentence the word "coffee" is twice.
+1
Forgot the "coffee " in "coffee bean". Obviously the "coffee." didn't meet the selection criteria. 😀
October 28, 2015 at 2:54 am
Should be five. I ran the query and it returned 5 rows. Hmmm... 😉
October 28, 2015 at 3:04 am
All rows are returned.
Probably author intended to put a trap on line 1 with 'coffee.' but there is also a ' coffee ' at the beginning.
I suppose the score and result must awarded considering the correct result.
October 28, 2015 at 3:13 am
The other potential "trap" is that depending on the collation settings (which were not mentioned) the LIKE operator can be case sensitive so the sentences starting with "Coffee" wouldn't match; the default for SQL Server will match them though.
October 28, 2015 at 3:32 am
Am I missing something here?
All rows are returned, but that is five rows not four.
Off to get my coffee.......
October 28, 2015 at 3:33 am
Oops!
October 28, 2015 at 3:53 am
How it is 4? it will return 5 (all rows which are inserted) and 5 should be the answer
October 28, 2015 at 4:04 am
This was removed by the editor as SPAM
October 28, 2015 at 4:05 am
Stewart "Arturius" Campbell (10/28/2015)
My first thought upon seeing the result was "Hmmm, maybe my first 2 cups of coffe have not kicked into gear yet, maybe i need another".however, even after the third cup, the answer still does not make sense.
The idea behind the question was good, just a glitch with execution...
Only three?! You need five! Or is it four....?
October 28, 2015 at 4:11 am
It is you? who is wrong.
I tried this example and received FIVE records:-P
October 28, 2015 at 4:26 am
Actually on my system the answer is an error because the table would be created in my personal schema but then the insert and select are from dbo. Converting everything to a temporary table, the select returns 5 rows.
October 28, 2015 at 4:43 am
Hey Folks, It happens on QotD. Don't worry Steve will fix it 😉
As per the question, good basic question thanks for sharing. And Steve you will be be very happy to see the 84% have answered 5 😀
Cheers!!!
October 28, 2015 at 4:45 am
I'm in the 5 camp as well. Perhaps someone could nudge the question setter to double check his question and answer! 🙂
October 28, 2015 at 4:53 am
david.dilworth (10/28/2015)
I'm in the 5 camp as well. Perhaps someone could nudge the question setter to double check his question and answer! 🙂
It happens every now and again - points are usually awarded back in the case of something being totally incorrect so you won't miss out (If you're worried about them).
Did make me think though - thought I'd missed something sneaky at first so read it a lot more carefully the second time round 🙂
Viewing 15 posts - 16 through 30 (of 85 total)
You must be logged in to reply to this topic. Login to reply