GATE DA 2025 · Schema for Multidimensional Data Models (Star, Snowflake)

MCQ · 2 marks · Problem DBMS-DTRN-0012

Consider a fact table in an OLAP application: Facts(\(D_1, D_2\), val), where \(D_1\) and \(D_2\) are its dimension attributes and val is a dependent attribute. Suppose attribute \(D_1\) takes 3 values and \(D_2\) takes 2 values, and all combinations of these values are present in the table Facts. How many tuples are there in the result of the following query?
SELECT D1, D2, sum(val)
FROM Facts
GROUP BY CUBE (D1, D2);
  1. A
    1
  2. B
    6
  3. C
    9
  4. D
    12

Solve it on GATE DA practice →More Data Warehouse Modelling problems

Show the worked solutionA data cuboid corresponds to a specific subset of dimensions being "grouped by" (with the rest aggregated away). With \(2\) dimensions \(D_1\) (taking \(3\) values) and \(D_2\), the fact table's cuboids include: the base cuboid (grouped by both \(D_1,D_2\): \(3\times(\text{values of }D_2)\) cells), the two single-dimension cuboids (grouped by just \(D_1\): \(3\) cells; grouped by just \(D_2\): (values of \(D_2\)) cells), and the "ALL" cuboid (\(1\) cell, fully aggregated).Working through the specific given value counts for \(D_1(3)\) and \(D_2\) and summing cells across all four cuboid levels gives a total of 12 distinct cells.Answer: 12Click Here for Detail SolutionGateOverflow discussion: https://gateoverflow.in/460986/gate-da-2025-question-36

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com