• I too lucked out. I didn't like the question as posed. Having individual orders with odd quantities and pricing, was placed it out of the scope of a QotD in my opinion. I like the idea of presenting grouping sets, however, having to resort to mulitple uses of calculator (e.g. 12 * 6.57) to find totals became more of a time demand than I was ready to invest.

    Perhaps, an interesting question might have been:

    How many distinct groups are created? (4).

    For the first two questions it seems they should have included "by any one employee."

    The below will generate answers different to those credited but seem to more accurately reflect the question posed.

    If instead we used the following

    GROUP BY GROUPING SETS (

    (custid) -- Addresses first two questions (sold and quantity to one customer)

    ,(empid) -- Addresses third question (emp id with highest sold)

    ,(YEAR(orderdate)) -- Addresses last question (year with highest quantity sold)

    )