wildcards

  • raulggonzalez (9/11/2013)

    making a research is usually what I do when I don't know the answer for sure. Copy/paste+F5 and select the right answer is cheating, period. 😀

    Though I'd agree that just doing a copy/paste + F5 and nothing else is a bit pointless, actually testing it before you answer is part of the fun, you get to make sure you are correct, and figure out the reasons for anything you got wrong yourself without being handed it on a plate with the QotD answer.

    As for researching first, most of the questions have a twist to them, or the person asking wouldn't have found them intriguing enough to post in the first place, few of them are completely straightforward, so there's nothing wrong with researching and testing first, so on that front I have to disagree, there is no cheating involved.

    For example I read this question, researched the ^ because I wasn't sure about that, I've never used it before, I then decided what i thought would be the correct answer and then tested it, at this point I realised the question was wrong as there was no ERROR answer. So I altered the script to what the asker obviously meant to ask, and the test then worked perfectly, I got the answer correct. I don't see that there was any cheating involved there.

    Now we have 11 pages of people who never tested first, thought they knew the answer (even though the ERROR answer wasn't available which should have been a big hint), and answered incorrectly. Yes the question was wrong, but if people tested first they would have realised that and answered correctly.

    Sorry to put peoples noses out.

  • Ross.M (9/11/2013)


    raulggonzalez (9/11/2013)

    making a research is usually what I do when I don't know the answer for sure. Copy/paste+F5 and select the right answer is cheating, period. 😀

    Though I'd agree that just doing a copy/paste + F5 and nothing else is a bit pointless, actually testing it before you answer is part of the fun, you get to make sure you are correct, and figure out the reasons for anything you got wrong yourself without being handed it on a plate with the QotD answer.

    +1

    I was taught to check my work before turning in my test paper.

  • batgirl (9/11/2013)


    Ross.M (9/11/2013)


    raulggonzalez (9/11/2013)

    making a research is usually what I do when I don't know the answer for sure. Copy/paste+F5 and select the right answer is cheating, period. 😀

    Though I'd agree that just doing a copy/paste + F5 and nothing else is a bit pointless, actually testing it before you answer is part of the fun, you get to make sure you are correct, and figure out the reasons for anything you got wrong yourself without being handed it on a plate with the QotD answer.

    +1

    I was taught to check my work before turning in my test paper.

    Checking your work is different from having the answer given to you. I think there are two different things being discussed in this thread. One is the issue with question creation and testing, and the other is credit for the correct answer.

    The correct answer given the original question is 0 rows. Noticing that by reviewing the code in your head is not cheating. Copying and pasting the code and running it is. In this case it's not necessarily a big deal because running through the code mentally isn't that difficult. But with other code it could be harder to "desk check it" than it is to just run it, so running the code defeats the purpose of the quizzing.

    Imagine a crossword puzzle page where you could copy the questions into a management tool and run the questions to get the answers. Do you think that would be fair to say you completed the puzzle? Or, forgetting fair, would you find it fun or think points had any meaning in that case?

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • L' Eomot Inversé (9/11/2013)


    isaquedejair (9/11/2013)


    Discordo do resultado ser "2", pelo fato de que no momento de gerar o insert ocorre um erro

    "String or binary data would be truncated.", o ultimo nome 'Steppenwolf' excede 10 caracteres

    É galego ou é portugués?

    Nenhum dos dois, é português. ;]

  • oops! This was not expected...

    Msg 8152, Level 16, State 14, Line 3

    String or binary data would be truncated.

    The statement has been terminated.

  • webrunner (9/11/2013)


    The correct answer given the original question is 0 rows. Noticing that by reviewing the code in your head is not cheating. Copying and pasting the code and running it is. In this case it's not necessarily a big deal because running through the code mentally isn't that difficult. But with other code it could be harder to "desk check it" than it is to just run it, so running the code defeats the purpose of the quizzing.

    Imagine a crossword puzzle page where you could copy the questions into a management tool and run the questions to get the answers. Do you think that would be fair to say you completed the puzzle? Or, forgetting fair, would you find it fun or think points had any meaning in that case?

    - webrunner

    Actually the correct answer would be an error, by testing it first you see this and can adjust your theory. If I research and form my answer first, then test it before actually marking down the answer, that's not cheating, that's being thorough. I have already reached my own conclusion before testing, that's the point of testing, you are testing your theory. That's totally different to just reaching for the answer.

    To use your crossword analogy, I would much rather have the option of attempting the crossword, then going back and figuring out what I got wrong, and correcting it, than to realise half way through that i've messed up on the first answer and screwed up the entire crossword.

    Most of us are DBAs or developers, TEST, TEST, TEST AGAIN.

  • Tom_Sacramento (9/11/2013)


    Hi Steve - Kinda of a dirty trick changing the question...

    The question posed at the front page sets mychar to varchar(10) which would fail the batch insert so 0 is correct there.

    However, on the QOD page mychar is set to varchar(50) which results in 2 records returned...

    Any chance of some mercy since the questions did not match?

    The two items are always the same. If they were different, you had an old version of the page (or the newsletter) and didn't notice the change.

    I changed the question and awarded back all points, in that order.

  • Richard Warr (9/11/2013)


    Secondly, and more importantly, I am a computer professional. I work in a world of absolutes. Compilers do not give you credit for the code you intended to write. They execute what you did write, and if it is wrong you have to fix it (except in the extremely rare case of a Good Bug).

    Me too. Have you never been given a spec and taken it back saying "I think you really mean this"? Although the relationship between coder and compiler may be absolute, that between coder and client is far from it.

    Of course I have.

    But if a colleague gives me a chunk of code, and says that it is working, I will integrate it and use the value it returns. Especially if that person is more of an expert than I am, and I am not privy to the spec he or she designed the code under.

  • Ok, no more picking on Steve. It is said: "Let him who has no sin cast the first stone."

  • Ross.M (9/11/2013)


    webrunner (9/11/2013)


    The correct answer given the original question is 0 rows. Noticing that by reviewing the code in your head is not cheating. Copying and pasting the code and running it is. In this case it's not necessarily a big deal because running through the code mentally isn't that difficult. But with other code it could be harder to "desk check it" than it is to just run it, so running the code defeats the purpose of the quizzing.

    Imagine a crossword puzzle page where you could copy the questions into a management tool and run the questions to get the answers. Do you think that would be fair to say you completed the puzzle? Or, forgetting fair, would you find it fun or think points had any meaning in that case?

    - webrunner

    Actually the correct answer would be an error, by testing it first you see this and can adjust your theory. If I research and form my answer first, then test it before actually marking down the answer, that's not cheating, that's being thorough. I have already reached my own conclusion before testing, that's the point of testing, you are testing your theory. That's totally different to just reaching for the answer.

    To use your crossword analogy, I would much rather have the option of attempting the crossword, then going back and figuring out what I got wrong, and correcting it, than to realise half way through that i've messed up on the first answer and screwed up the entire crossword.

    Most of us are DBAs or developers, TEST, TEST, TEST AGAIN.

    My point is that the process of "going back and figuring out what I got wrong, and correcting it" should not be rewarded by a point system. I totally agree that it is the best way to achieve the "correct" answer - that is, the actual result regardless of what answer the question provider selected as correct - but it is not a test of someone's ability to access the knowledge in their heads.

    What you describe is more akin to quality assurance testing of the question by running the SQL code, and so to me is comparable to cheating on a quiz. Or like using a calculator on a simple arithmetic exam that prohibits calculators. Or rather, I don't think any teacher would give grade credit in that situation, even if they allowed students to use calculators and the exercise was valuable to let students practice and test their skills.

    This instance is more a special case of quality checking than one of finding the right answer. Suppose, for instance, that 0 had not been one of the answers provided. Now there would be no correct answers to choose from. The only option would be to send a message to the question provider that the question has an error. To me there is no sensible way to assign points for a "correct" answer in that case.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Hany Helmy (9/11/2013)


    I am really amazed of the 16 people (as of now) who got it right! :w00t:

    Hope one of them will post a reply explaining how he got the result without throwing an error.

    Very easy. Just answer the question the way it is intended: by looking at the code and not copy/paste-ing it.

    I saw the subject of the question, saw the question, and concentrated on the wildcards in the LIKE. I never checked the data types of the table.

    (Yes, I only answered after the question was already corrected. But that was irrelevant to me - I had completely not looked at the data types anyway).

    And to all people who think they need to post to "get their point back" - rubbish! Points are never subtracted for giving an incorrect reply. You didn't lose anything.

    (And even if you post a million posts, you still don't get extra points for the "Question of the Day" category).

    I am still waiting for the day Steve finally comes to his senses and gets rid of the points system. (Though the idea to subtract points for posting useless rubbish does have a nice ring to it).


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Koen Verbeeck (9/11/2013)


    ChrisM@Work (9/11/2013)


    Hany Helmy (9/11/2013)


    I am really amazed of the 16 people (as of now) who got it right! :w00t:

    Hope one of them will post a reply explaining how he got the result without throwing an error.

    Simple - always mark your answer before running the code. Any fool can run the code to get a QotD correct. Or not, in this case.

    You will learn far more from trying to figure out the answer and getting it wrong than running the code and getting it right.

    Indeed. As if I'm going to count the number of characters in Steppenwolf.

    Nice basic question Steve, thanks.

    Born to be wild!

    +1

  • I am so glad I got to the QoTD late today. Easy one. Thanks Steve!

  • The question on the home page says the definition of the table column is VARCHAR(10) but in the question on the second page the definition is VARCHAR(50). Is this a reading test or a SQL test?

  • Once again, the advantage of being on the West Coast and doing QotDs during lunch break: they are already corrected! 😉

    Thanks, Steve!

Viewing 15 posts - 106 through 120 (of 145 total)

You must be logged in to reply to this topic. Login to reply