Microsoft Fabric Data Engineer Associate DP-700 Practice Question
The Sales table in a Microsoft Fabric Warehouse has columns region, product_category, and amount. Write one T-SQL query that returns: 1) totals per (region, product_category), 2) subtotals per region, 3) subtotals per product_category, and 4) an overall total. Which GROUP BY clause accomplishes this with the least code?
GROUP BY GROUPING SETS ((region, product_category), (region), (product_category))
The GROUP BY CUBE (region, product_category) clause produces all possible grouping combinations of the specified columns. It returns the detailed aggregates for each region-category pair, single-column subtotals for region and product_category, and the grand total (the empty grouping).
GROUP BY ROLLUP returns hierarchical totals but omits the cross-tab subtotals for product_category alone. GROUP BY GROUPING SETS with (region, product_category), (region), (product_category) lacks the grand total because the empty set () is not included. GROUP BY region, product_category returns only the detailed combinations with no subtotals or grand total.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between GROUP BY CUBE and GROUP BY ROLLUP?
Open an interactive chat with Bash
How does GROUPING SETS differ from GROUP BY CUBE?
Open an interactive chat with Bash
What is the concept of the empty grouping in GROUP BY CUBE?
Open an interactive chat with Bash
Microsoft Fabric Data Engineer Associate DP-700
Ingest and transform data
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .