Alias Usage

  • Comments posted to this topic are about the item Alias Usage

  • Nice, easy and back-to-basics question; perfect for Monday mornings 🙂

    Thanks Ismail!

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • easy question for the monday morning 🙂

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Lokesh Vij (6/16/2013)


    Nice, easy and back-to-basics question; perfect for Monday mornings 🙂

    Thanks Ismail!

    +1

    I wonder how 28 % got it wrong...

    Edit :

    -- error; incorrect alias

    SELECT ProductID Name Color FROM Product

    GO

    -- no error and correct alias

    SELECT ProductID [Name Color] FROM Product

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • I wonder how 28 % got it wrong...

    As only 6% selected the wrong answer it must be down to not selecting three options. If you don't read the question you won't get the point 😉

  • Easy one, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • demonfox (6/17/2013)I wonder how 28 % got it wrong...

    Inability to read in my case :hehe:

  • Thanks ismail.You everywhere:)

  • Simple One

  • Richard Warr (6/17/2013)


    I wonder how 28 % got it wrong...

    As only 6% selected the wrong answer it must be down to not selecting three options. If you don't read the question you won't get the point 😉

    Possibly the coffee, since the topic specifically says "Alias usage". It means there should be something about an alias in the Question.

    Although, the explanation doesn't talk about alias at all. It's on the column usage with an occurance of the alias usage.

    if you want to list more than one column in select statement, T-SQL syntax requires coma between column names.......On the other hand if you have two column names without a comma.....the first one is parsed as a column name and the second one is evaluated as an column alias

    nevertheless, missing a comma could have a different result set. So, a typo does mean something in sql server.

    Edit: english

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • 🙂

    HI!

    Easy...

    Nice One...

    After Long time answering for easy question

    Thanks

    Anshul Gupta

    anshulguptamca10@gmail.com

  • As only 6% selected the wrong answer it must be down to not selecting three options. If you don't read the question you won't get the point 😉

    In my case it was a combination of three things: one, I never read the title of the QotD; two, I missed the (select 3) bit at the end; and third, I *always* use AS to specify column aliases because I find the alternative causes confusion. C'est la vie...

  • paul.knibbs (6/17/2013)


    ... and third, I *always* use AS to specify column aliases because I find the alternative causes confusion....

    Agreed. I got this one right primarily because I've been bitten by this when other people have not used AS. I wish there were an option to require it...

    Also, here's a link to the SELECT clause, to provide the reference link that would have made the answer complete: http://msdn.microsoft.com/en-us/library/ms176104.aspx

  • Richard Warr (6/17/2013)


    I wonder how 28 % got it wrong...

    As only 6% selected the wrong answer it must be down to not selecting three options. If you don't read the question you won't get the point 😉

    That's right. since you comment it's got worse.

    Now we have 10% who selected the wrong option. As 30% got it wrong, that means 20% of people who answered selected the wrong number of options but not the wrong option, so selecting too few options was a much bigger cause of failure than selecting the wrong option. The number of answers selected is about 275% of the number of attempts, so on average people selected two and three quarter answers. About 9% of people selected both the 1st option and the third option (the incorrect option), so it seems likely that some of those 10% selected all four options, so the people not selecting the wrong option may have contributed more than two thirds of the 30% deficit in number of options selected; as option 4 had lot fewer ticks than the other correct options, I would guess that about 10% and 20% of people selected only 2 options and some more selected only 1 option.

    It's a nice question, very simple and straightforward, and the number getting it wrong is rather surprising. 20% getting it wrong because they didn't bother to read the question properly is pretty sad, but not really surprising; 10% not knowing the syntax of an extremely simple select statement is amazing.

    Tom

  • I noticed the "select 3" after hitting submit.

    I didn't see the title because I clicked the QotD link from email.

    I assumed "run successfully" meant "returns what it looks like it should" rather than "without error"

    All of these failures are my fault - just wanted to share some explanation for the high wrong answer rate 🙂

Viewing 15 posts - 1 through 15 (of 31 total)

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