Dell-EMC
E20-007 · Question #112
Review the following code: SELECT pn, vn, sum(prc*qty) FROM sale GROUP BY CUBE(pn, vn) ORDER BY 1, 2, 3; Which combination of subtotals do you expect to be returned by the query?
The correct answer is D. ( (pn,vn),(pn),(vn),( ) ). See the full explanation below for the reasoning.
Question
Review the following code:
SELECT pn, vn, sum(prc*qty) FROM sale GROUP BY CUBE(pn, vn) ORDER BY 1, 2, 3; Which combination of subtotals do you expect to be returned by the query?
Options
- A(pn,vn)
- B( (pn,vn),(pn) )
- C( (pn,vn),(pn),(vn) )
- D( (pn,vn),(pn),(vn),( ) )
How the community answered
(26 responses)- A4% (1)
- B4% (1)
- C15% (4)
- D77% (20)
Community Discussion
No community discussion yet for this question.