Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

TOP and TABLESAMPLE Expand / Collapse
Author
Message
Posted Wednesday, July 30, 2008 9:53 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 2:10 PM
Points: 2,669, Visits: 781
No apology necessary - I always get them wrong when I am sure I know the answer. I learned something - that's more important than the points (frosting).

Jamie
Post #543658
Posted Wednesday, July 30, 2008 10:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 10:58 AM
Points: 5,333, Visits: 25,272
DISREGARD THIS RANTING
Correct answer: select top 1000 col1 from bigtable, select top 10 percent col1 from bigtable


I too selected a single answer not multiple answers

KevRiley - please accept my sincere apologies for my stupidity


I have edited my previous 2 posts to reflect the above.

Again - thanks for not kicking my butt too hard, but I deserved it


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

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #543670
Posted Wednesday, July 30, 2008 10:13 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
Finally found the source of confusion:
Which of the following statements is guaranteed to return 1000 rows

instead of
Which of the following statements are guaranteed to return 1000 rows


But the answer possibilities and checkboxes do not leave much room for confusion. (unless one ignores the last 3 answers, which is never a good idea.

Thanks for the very good question, keep it up!


Best Regards,
Chris Büttner
Post #543675
Posted Wednesday, July 30, 2008 10:16 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 11:01 AM
Points: 2,401, Visits: 1,485
Not to cause a problem here but I think that I agree with bitbucket on this one. But there is more to this then a simple question and answer.

The QOTD has been an opportunity for many to learn a little something each day, as well it has been a reminder of what you may already know.

The question was to make a selection for the best answer. It clearly did not say select the best answer or answers, or choose all that apply. As a result we looked at the question as being straight forward. It was not.

The possible intent then of the question might not have been trying to get the right answer but to be deceptive in approach and to reinforce the negative. This also is a powerful tool in learning for you remember those professors and others who pose questions designed to make you fail. They generally are hated at the time and some are never appreciated but they teach us a much more important lesson then a simple sql construct or some class materials. They teach us that we need to be aware at all times no matter who or what we are dealing with, for even the trusted can lead you astray if you are not aware.

The lesson you are providing here is far more important then you know. For those who appear to be telling it like it is, may have an agenda to point you in their direction for their gain instead of pointing at the truth.

Thanks:)

Miles...


Not all gray hairs are Dinosaurs!
Post #543679
Posted Wednesday, July 30, 2008 10:22 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 16, 2014 2:35 AM
Points: 2,716, Visits: 2,471
bitbucket - no worries - I was only trying to understand how best to help you - so no butt kicking here!

Another lesson learned for me too - must write questions without (too much) ambiguity :D


Kev
Post #543684
Posted Wednesday, July 30, 2008 11:30 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Wednesday, October 22, 2014 12:34 PM
Points: 31,181, Visits: 15,626
OK, this is more my fault than Kevin's.

To start, "is" changed to "are" and "select all that apply" added. I should have done that.

The engine is built to show radio buttons if one answer is required, checkboxes if 2 or more are correct. That's how the MS tests work, but it also means there's a trick. If I forget the "select all the apply", you have to know that at least 2 answers are required. I'm not sure if I'd always like to have checkboxes, though that would remove the confusion from questions.

I also can't an an either/or for partial credit. Enhancement is needed here, but I'm not sure how I can do this without confusing myself more often than not

I thought it was a good question, but I didn't read into it like a few of you. I also see it from a different perspective, so apologies for any confusion. The intent from me, and I'm guessing Kevin, was not to confuse, but show that SAMPLE isn't necessarily accurate.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #543743
Posted Wednesday, July 30, 2008 12:08 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Wednesday, October 22, 2014 12:34 PM
Points: 31,181, Visits: 15,626
As an FYI, I'm not upset about the complaints. I completely understand how it looks from your side and I apologize.

The QOD is a hard place to get a good question written. And it's hard to think about all the ways things can be interpreted. You have valid reasons for not liking the question and I hope we've fixed them for people answering now and we'll keep them in mind in the future.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #543787
Posted Friday, August 8, 2008 3:59 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, January 22, 2009 9:09 AM
Points: 211, Visits: 18
I've been caught out by the multiple answer thang before - but never again!

This argument over lost points is hiding how good a question this is. Who at MS decided that a tablesample of 1000 rows should return *approximately* 1000 rows! I can see that 10 percent might be an approximation - but an exact number of rows! Sheesh.

From BOL:

When a number of rows is specified, rather than a percentage based on the total number of rows in the table, the number is converted into a percentage of the rows, and therefore, pages, that should be returned. The TABLESAMPLE is then performed with that computed percentage.


This is silly.



Post #548976
Posted Wednesday, September 10, 2008 7:58 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:38 PM
Points: 35,371, Visits: 31,912
Wow... although I've not needed to use it, I've heard about TableSample before. Didn't know it would return a random number of rows in the rows mode. What a POS command it is. If you use (10 rows) on a 10,000 row table, you get 0 rows. The guys that put that on together need a porkchop dinner Moden style! :P

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #567428
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse