VIEWS 6

  • Comments posted to this topic are about the item VIEWS 6

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thanks for the easy question. It seems like you are very specialist in views.

    Cheers !!!!!.

  • Thanks for the question.

    I was looking for a catch, but apparently there was none πŸ™‚

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

  • I do not like this kind of EXTREMELY easy questions.

    πŸ˜€

  • Easy one...like it,thank you.

    β€œWhen I hear somebody sigh, β€˜Life is hard,’ I am always tempted to ask, β€˜Compared to what?’” - Sydney Harris

  • Koen Verbeeck (4/10/2012)


    I was looking for a catch, but apparently there was none πŸ™‚

    This ^.^ Glad there is no one awake around here at this hour. I'm sitting here talking to myself outloud, "No! But what am I not getting?!? No, It wouldn't make any sense!" I was gonna be very disappointed if it didn't work the way I was sure it was suppose to. πŸ˜€ Thanks!

  • Not as easy as I thought it would be:

    Correct answers: 75% (272)

    Incorrect answers: 25% (91)

    Total attempts: 363

    Since one of the major objectives of the QOD is to teach I guess some 91 people learned something new, or just maybe have not had their morning cup of coffee.

    And the last of my questions concerning VIEWS is currently scheduled for May 8th.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • I think the higher than expected number of incorrect answers may be due to people finding the question a little unclear. Here is another way of phrasing what I am guessing was intended:

    Is the value for Col2 updated in the row where the value of Id =1 ?

    As the question was written, "where the value of Id =1 updated" implies that the value of Id = 1 somehow updated as part of the update statement. I'm not sure that's what was intended.

  • I should have gone back and double checked. I assumed it was just asking about a view updating the underlying table, not about the update violating the column constraints. So that's one incorrect answer due to poor reading.

  • bitbucket-25253 (4/10/2012)


    Not as easy as I thought it would be:

    Correct answers: 75% (272)

    Incorrect answers: 25% (91)

    Total attempts: 363

    Since one of the major objectives of the QOD is to teach I guess some 91 people learned something new...

    Probably more than that, as some people who didn't know the answer likely guessed right. πŸ™‚

    Thanks for the question!

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • cfradenburg (4/10/2012)


    I should have gone back and double checked. I assumed it was just asking about a view updating the underlying table, not about the update violating the column constraints. So that's one incorrect answer due to poor reading.

    Yup, ditto here. I checked the view definition and forgot to check for nullability.

  • SandyD (4/10/2012)


    I think the higher than expected number of incorrect answers may be due to people finding the question a little unclear. Here is another way of phrasing what I am guessing was intended:

    Is the value for Col2 updated in the row where the value of Id =1 ?

    As the question was written, "where the value of Id =1 updated" implies that the value of Id = 1 somehow updated as part of the update statement. I'm not sure that's what was intended.

    I had absolutely no ambiguity at all in the question. When I read your comment I was a bit surprised how confusing that was. Then I went back and looked at the question again and you only included the second half of the question. The original question reads...

    Is the value for Col2 in the row where the value of Id =1 updated ?

    How can that imply that the column Id was updated? I suppose that non native English speakers may find that a little more difficult but it is crystal clear to me.

    Great question Ron. It seems that there are still a lot of people who needed to learn this (23% incorrect at the time of this posting).

    _______________________________________________________________

    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/

  • bitbucket-25253 (4/10/2012)


    Not as easy as I thought it would be:

    Correct answers: 75% (272)

    Incorrect answers: 25% (91)

    Total attempts: 363

    Since one of the major objectives of the QOD is to teach I guess some 91 people learned something new, or just maybe have not had their morning cup of coffee.

    Good question. But I don't find 25% getting it wrong at all surprising.

    I imagine what most of those 91 learnt was to be a bit more careful in their reading: a lot of people will have seen at a glance that the view is an updatable view of a single table and that the where clause of the update query unambiguously defines which underlying data is to be updated, and gone for "yes" because the question is about updating through a view, then kicked themselves because they had carelessly failed to check that the new value was legal for the column. I've seen so much of that sought of carelessness in practice that I reckon that's a very important lesson for DBAs and Developers to learn (especially those doing 2nd or 3rd line support, who often have quite extensive power to modify production systems, and those doing QA, who have the power to let all sorts of rubbish get into production if they are careless). So keep up the good work with more questions like this.

    But the choice of reference was not really a good one; that BoL page doesn't tell you anything about this QotD except to go look at a different BoL page.

    Tom

  • Great question, Ron. Back to basics, for views make sure you also know the table definition and/or possible restrictions for it (nullability, PKs/FKs, etc.). You don't take for granted a table can be updated through a view just because the view allows updates, right?

    "El" Jerry.

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • great question. cheers Ron!

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

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