nerdexam
Microsoft

70-451 · Question #38

You are a database developer. You plan to design a database solution by using SQL Server 2008. The database includes a table that contains the following product inventory information: - Department…

The correct answer is D. Write a single query that contains a GROUP BY GROUPING SETS clause. See the full explanation below for the reasoning.

Question

You are a database developer. You plan to design a database solution by using SQL Server 2008. The database includes a table that contains the following product inventory information:

  • Department
  • Class
  • Item
  • Quantity

You plan to write a query that produces the sum of quantity data broken into the following groups:

  • Department
  • Department and Class
  • Department and Item
  • Department, Class, and Item

You need to write the query by using the minimum possible number of Transact-SQL statements. What should you recommend?

Options

  • AWrite a single query that contains a GROUP BY clause.
  • BWrite a single query that contains a GROUP BY WITH CUBE clause.
  • CWrite a single query that contains a GROUP BY WITH ROLLUP clause.
  • DWrite a single query that contains a GROUP BY GROUPING SETS clause.

How the community answered

(53 responses)
  • A
    4% (2)
  • B
    6% (3)
  • C
    13% (7)
  • D
    77% (41)

Community Discussion

No community discussion yet for this question.

Full 70-451 Practice