April 9, 2012 at 11:11 pm
Thanks for the easy question. It seems like you are very specialist in views.
Cheers !!!!!.
April 10, 2012 at 12:36 am
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
April 10, 2012 at 1:25 am
I do not like this kind of EXTREMELY easy questions.
π
April 10, 2012 at 1:59 am
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
April 10, 2012 at 2:58 am
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!
April 10, 2012 at 5:52 am
Not as easy as I thought it would be:
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.
April 10, 2012 at 6:56 am
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.
April 10, 2012 at 6:59 am
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.
April 10, 2012 at 7:13 am
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
April 10, 2012 at 7:25 am
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.
April 10, 2012 at 7:47 am
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/
April 10, 2012 at 8:24 am
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
April 10, 2012 at 8:53 am
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.
April 10, 2012 at 9:42 am
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