Cube v rollup

  • Comments posted to this topic are about the item Cube v rollup

  • Interesting question, thanks Steve
    Haven't used CUBE/ROLLUP in a long time - much prefer GROUPING SETS

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    β€œlibera tute vulgaris ex”

  • Not sure I follow the reasoning behind the correct answers. WITH CUBE returns more rows, but not WITH ROLLUP. And yet they return the same number of rows? How is this reasonable?

    As I see it, this should not have been a multiple choice question, but rather a single choice with "They return the same number of rows" as the correct answer.


    Just because you're right doesn't mean everybody else is wrong.

  • Steve Jones - SSC Editor - Wednesday, December 13, 2017 10:04 PM

    Comments posted to this topic are about the item Cube v rollup

    I got it right but I really wanted the answer to be Cube, Rollup and same number of rows, because "in this case" as the answer states cube and rollup return the same number.

  • Presumably there's a mistake in the question requiring 2 answers and it is meant to be a single-answer question? The only possible answer if 2 are correct would be that Rollup returns more and With Cube syntax is wrong, yet neither of those is true!

  • Rune Bivrin - Thursday, December 14, 2017 1:17 AM

    Not sure I follow the reasoning behind the correct answers. WITH CUBE returns more rows, but not WITH ROLLUP. And yet they return the same number of rows? How is this reasonable?

    As I see it, this should not have been a multiple choice question, but rather a single choice with "They return the same number of rows" as the correct answer.

    I don't follow it either. Please enlighten us.

  • Apologies. Accidentally checked two boxes. This has been fixed and the points awarded back.

    In this case, with one group by column, both operators return the same number of rows.

  • Steve Jones - SSC Editor - Thursday, December 14, 2017 2:50 AM

    Apologies. Accidentally checked two boxes. This has been fixed and the points awarded back.

    In this case, with one group by column, both operators return the same number of rows.

    Hello πŸ™‚
    I had this problem today morning when I tried to answer it I chose that the right option was the one that says that both were correct since I know that cube and rollup have the same behavior when there is only one dimension being used, but I got a message saying that I had to choose two options.. well I did not give up on me and I picked cube and rollup option, but then told me that the right question was the first one I picked πŸ™ .. I'm still seeing that my answer is wrong I just want my point on this one πŸ˜›

    A. Mauricio Repetto
    ML Engineer

  • I definitely misinterpreted the question - I read it as "Which operator in the WITH clause results in more rows in the results than would be in in the set in the absence of the WITH clause? "  Obviously adding that extra verbiage was incorrect, but it caused me to misinterpret the answers, so as soon as I found one answer that worked I assumed I had the answer.  It also caused me to read "They return the same number of rows" as "they don't add rows to the result set returned in the absence of the WITH clause".  Doh!

  • amd.repetto - Thursday, December 14, 2017 10:08 AM

    Steve Jones - SSC Editor - Thursday, December 14, 2017 2:50 AM

    Apologies. Accidentally checked two boxes. This has been fixed and the points awarded back.

    In this case, with one group by column, both operators return the same number of rows.

    Hello πŸ™‚
    I had this problem today morning when I tried to answer it I chose that the right option was the one that says that both were correct since I know that cube and rollup have the same behavior when there is only one dimension being used, but I got a message saying that I had to choose two options.. well I did not give up on me and I picked cube and rollup option, but then told me that the right question was the first one I picked πŸ™ .. I'm still seeing that my answer is wrong I just want my point on this one πŸ˜›

    Yup. I'm in the same boat. But I've come to more or less expect a couple of back and fro's with Steve's QotD's. He seems to be using something I regularly advocate: CDT - Complaint Driven Development.

    Side note: This is actually a quite useful technique when dealing with users. They often don't know what they want  (or at least are unable to articulate it), but are quite capable of identifying things that don't work.


    Just because you're right doesn't mean everybody else is wrong.

  • Hmm... a trick question, I think.

Viewing 11 posts - 1 through 10 (of 10 total)

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