Microsoft Fabric Data Engineer Associate DP-700 Practice Question
You manage a Microsoft Fabric warehouse with a table dbo.FactSales (SaleDate, ProductCategory, Region, Quantity, SalesAmount). You must write one T-SQL query that returns: 1) total SalesAmount for every ProductCategory-Region pair, 2) totals per ProductCategory across all regions, 3) totals per Region across all product categories, and 4) a grand total. Using the least code, which GROUP BY clause achieves this?
GROUP BY GROUPING SETS ((ProductCategory, Region))
The CUBE grouping operator automatically generates every possible aggregation of the listed columns plus the overall total. GROUP BY CUBE (ProductCategory, Region) therefore returns:
Each ProductCategory-Region combination
Each ProductCategory with NULL in Region (all regions)
Each Region with NULL in ProductCategory (all categories)
One row with NULL in both columns for the grand total ROLLUP omits the Region-only subtotal, GROUPING SETS with a single set returns only detailed rows, and plain GROUP BY provides no subtotals.
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 does the GROUP BY CUBE operator do in T-SQL?
Open an interactive chat with Bash
How is GROUP BY ROLLUP different from GROUP BY CUBE?
Open an interactive chat with Bash
What is the purpose of GROUPING SETS in T-SQL?
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 .