GATE DA 2025 Q46: OLAP: rows returned by GROUP BY CUBE(D1, D2)
- Database Management and Warehousing
- 2 marks
- MCQ
- −2/3 if wrong
Question
Consider a fact table in an OLAP application: , where and are its dimension attributes and is a dependent attribute. Suppose attribute takes 3 values and takes 2 values, and all combinations of these values are present in the table . How many tuples are there in the result of the following query?
SELECT D1, D2, sum(val)
FROM Facts
GROUP BY CUBE (D1, D2);Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2025 final answer key)
Concept used: CUBE produces groupings for every subset of the listed dimensions.
First step: CUBE(D1, D2) groups by (D1, D2), (D1), (D2) and (): count the rows each grouping contributes.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Database Management and Warehousing PYQs
- 2025 · Q16Non-dependency-preserving decomposition: which operator runs more?
- 2025 · Q17Relational algebra on Car, Make and Own
- 2025 · Q33SQL: loans larger than every SR Nagar loan
- 2025 · Q56Keys and NULLs in Person and Customer tables
- 2025 · Q57Candidate keys and BCNF for R(ABCDEFG)
- 2025 · Q62Relational division: customers with loans at every branch