Finding Azure SQL Database

  • Read it wrong - id 3 is returned, but only 1 value:( Would have had it right otherwise...

  • but the question was how many ids were returned - I answered the same way you did.

  • This question was so simple that I started to doubt if it was a trick question.

    But no, it was that simple! 😀

  • Koen Verbeeck (10/16/2015)


    Easy one. Got it wrong though because I wasn't paying attention. Time for the weekend!

    Same here. Oops!!

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Apologies, explanation fixed.

  • I feel like I was obligated to get it right since I wrote the second article in the references. 😀

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Mighty (10/16/2015)


    This question was so simple that I started to doubt if it was a trick question.

    But no, it was that simple! 😀

    Just what I was thinking.

  • Argh!! Wasn't paying attention apparently and selected the id number and not the number of rows returned. 😛 I think I need to leave early today.

  • I was so hung up on the spaces before or after that I highlighted the text in my browser to check that there were no spaces on the ends of rows 2 and 4.

    And then I realised while looking at the highlighted text that there were missing spaces between the words so I was being an idiot and doing an unnecessary check. I got it right despite my silly start.

    As there were no final spaces I would have got it right even if I hadn't realised that a final space on one or both of those lines wouldn't add to the count. Maybe there should have been one to catch people who started like me and didn't realise they were being silly - or would that have counted as a trick question?

    Tom

  • TomThomson (10/16/2015)


    I was so hung up on the spaces before or after that I highlighted the text in my browser to check that there were no spaces on the ends of rows 2 and 4.

    And then I realised while looking at the highlighted text that there were missing spaces between the words so I was being an idiot and doing an unnecessary check. I got it right despite my silly start.

    As there were no final spaces I would have got it right even if I hadn't realised that a final space on one or both of those lines wouldn't add to the count. Maybe there should have been one to catch people who started like me and didn't realise they were being silly - or would that have counted as a trick question?

    To me it would, unless the data type is given in the question.

    Fixed length strings are padded with spaces.


    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/

  • That was ez & clear enough 4 me, thanx 4 the question.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Thanks for the easy question, Steve.

  • The explanation says, "Row 3 doesn't have a space before, so it does not match.". I think the explanation should have said, "Row 2 doesn't have a space before, so it does not match." Row 3 does match, and it is the only row that matches.

  • Spaces can be important.

  • Easy question.

    1 ==> missing spaces inside the searched string

    2 ==> not beginning by a space ( I missed it in an interview some years ago )

    3 ==> OK

    4 ==> missing space between SQL and Database

    5 ==> missing space between Windows and Azure

    1 minute to think...

Viewing 15 posts - 16 through 29 (of 29 total)

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