GATE DA Database Management and Warehousing PYQ with Solutions

Also searched as: GATE DBMS PYQ · GATE Data Warehousing PYQ · GATE SQL PYQ

All 11 Database Management and Warehousing questions from the GATE Data Science & Artificial Intelligence (DA) papers, starting with GATE DA 2026, with the official answer key and a step-by-step solution. Database Management and Warehousing carries about 18 marks per paper on average. Questions are grouped chapter-wise, newest paper first.

Database Management and Warehousing — average marks per paper
2026
18

Database Management and Warehousing: Data Warehousing — GATE DA PYQ (2)

  1. GATE DA 2026 · Q18Database Management and Warehousingmcq1 mark
    Consider that the visualization of a 3-dimensional data cube is showing Sales Quantity for each combination of the attributes Product Type, Month and Country. From this, if we want to further visualize the Sales Quantity for each combination of Product Type, Month and State, which of the following OLAP operations should be performed?
    • A.
      Slicing
    • B.
      Dicing
    • C.
      Roll-up
    • D.
      Drill-down
      ✓

    Answer: D

    Solution

    In the location hierarchy, Country is above State (Country, then State, then City). Going from Country to State moves to a finer level of detail, which is a drill-down (roll-down). Roll-up would go the other way (State to Country). Slicing and dicing select a sub-cube without changing the level of detail. Answer: (D) Drill-down.
    Open GATE DA 2026 Q18 · discuss this question →
  2. GATE DA 2026 · Q43Database Management and Warehousingmcq2 marks
    Consider the concept hierarchies as shown in the figure. Which of the following options denotes the total number of possible data cuboids from these concept hierarchies?
    GATE DA 2026 Question 43 figure
    • A.
      ✓
    • B.
    • C.
    • D.

    Answer: A

    Solution

    For dimensions where dimension has hierarchy levels, the number of cuboids is
    The is for the virtual top level "all", which means the dimension is aggregated away. Here there are 3 dimensions (Time: Year, Month, Day; Location: Country, State, City; Item: Category, Type, Item), each with 3 levels:
    Answer: (A) .
    Open GATE DA 2026 Q43 · discuss this question →

Database Management and Warehousing: Indexing — GATE DA PYQ (2)

  1. GATE DA 2026 · Q32Database Management and Warehousingnat1 mark
    In a relational database, a B+ Tree Index is to be constructed for a relation on a key field. In a B+ Tree, a Node Pointer points to a sub-tree and a Data Record Pointer points to a block of database records. Let, Node size = 4096 bytes, Node Pointer size = 10 bytes, Search Key Field size = 11 bytes and Data Record Pointer size = 12 bytes. The maximum number of Node Pointers that can be present in a non-leaf node of the B+ Tree is ________ . (Answer in integer)

    Answer: 195

    Solution

    A non-leaf node with node pointers holds keys (data record pointers appear only in leaves):
    So . Check: . Answer: 195.
    Open GATE DA 2026 Q32 · discuss this question →
  2. GATE DA 2026 · Q41Database Management and Warehousingmcq2 marks
    Consider a B+ Tree where the maximum number of key values in each leaf node is 2 and the maximum number of pointers in each non-leaf node is 3. Let the content of the B+ Tree be as shown in the figure. Which of the following options denotes the key value(s) stored in the root node after inserting a key value 3 in the given B+ Tree?
    GATE DA 2026 Question 41 figure
    • A.
      5
      ✓
    • B.
      8
    • C.
      3 and 5
    • D.
      3, 5 and 8

    Answer: A

    Solution

    The root holds keys 5 and 8 with three children: leaves , and . 1. Key 3 belongs in the first leaf, which becomes . That overflows (maximum 2 keys), so it splits into and , and the separator 3 is copied up to the parent. 2. The parent would now hold keys with 4 child pointers, but non-leaf nodes allow at most 3 pointers. It splits: the middle key 5 moves up to a new root, the left internal node keeps 3, and the right internal node keeps 8. The new root contains only the key 5. Answer: (A) 5.
    Open GATE DA 2026 Q41 · discuss this question →

Database Management and Warehousing: SQL — GATE DA PYQ (2)

  1. GATE DA 2026 · Q51Database Management and Warehousingmsq2 marks
    Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column. We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
    Employee              Output
    EmpID  TeamID         EmpID  TeamSize
    1      8              1      3
    2      8              2      3
    3      8              3      3
    4      7              4      2
    5      7              5      2
    6      9              6      1
    Which of the following is/are correct?
    • A.
      sql
      SELECT E.EmpID, B.TeamSize FROM Employee AS E, (SELECT TeamID, COUNT(TeamID) AS TeamSize FROM Employee GROUP BY TeamID) AS B WHERE E.TeamID = B.TeamID
      ✓
    • B.
      sql
      SELECT A.EmpID, COUNT(B.TeamID) AS TeamSize FROM Employee AS A, Employee AS B WHERE A.TeamID = B.TeamID AND A.EmpID = B.EmpID GROUP BY A.EmpID
    • C.
      sql
      SELECT B.EmpID, B.TeamSize FROM (SELECT EmpID, COUNT(TeamID) AS TeamSize FROM Employee GROUP BY EmpID) AS B
    • D.
      sql
      SELECT A.EmpID, B.TeamSize FROM Employee AS A, (SELECT COUNT(TeamID) AS TeamSize FROM Employee GROUP BY TeamID) AS B WHERE A.TeamID = B.TeamID

    Answer: A

    Solution

    - (A) The subquery gives (TeamID, size) for each team. Joining each employee to their team's row gives the size. Correct. - (B) The condition A.EmpID = B.EmpID pairs each employee only with itself, so every count is 1. Wrong. - (C) Grouping by EmpID (the primary key) puts each employee in a group of size 1. Wrong. - (D) The derived table B has no TeamID column, so B.TeamID is invalid. Wrong. Answer: (A).
    Open GATE DA 2026 Q51 · discuss this question →
  2. GATE DA 2026 · Q60Database Management and Warehousingnat2 marks
    Let Account be a relation as shown.
    Account
    AccNo  Balance
    A1     5000
    A2     5000
    A3     10000
    A4     15000
    A5     18000
    Consider the given SQL query.
    sql
    SELECT AccNo FROM Account AS A WHERE (SELECT COUNT(*) FROM Account AS B WHERE A.Balance < B.Balance) >= (SELECT COUNT(*) FROM Account AS C WHERE A.Balance > C.Balance)
    The number of rows returned by the SQL query is __________ . (Answer in integer)

    Answer: 3

    Solution

    For each account, compare the number of higher balances with the number of lower balances:
    AccNo  Balance  higher  lower  higher >= lower?
    A1     5000     3       0      yes
    A2     5000     3       0      yes
    A3     10000    2       2      yes
    A4     15000    1       3      no
    A5     18000    0       4      no
    Three rows are returned. Answer: 3.
    Open GATE DA 2026 Q60 · discuss this question →

Database Management and Warehousing: Normalization — GATE DA PYQ (1)

  1. GATE DA 2026 · Q17Database Management and Warehousingmcq1 mark
    Let be a relational schema with functional dependency set . Which of the following statements is correct?
    • A.
      AD, ED and CD are the only candidate keys of R.
      ✓
    • B.
      AD and ED are the only candidate keys of R.
    • C.
      A, E and CD are the only candidate keys of R.
    • D.
      A and CD are the only candidate keys of R.

    Answer: A

    Solution

    never appears on the right side of an FD, so every key contains . - : gives , then gives . So is a key. - : gives , then gives . So is a key. - : , , gives . So is a key. - , so it is not a key. alone is not a key either. All three keys are minimal (no single attribute determines everything), so the candidate keys are exactly , and . Answer: (A).
    Open GATE DA 2026 Q17 · discuss this question →

Database Management and Warehousing: Integrity Constraints — GATE DA PYQ (1)

  1. GATE DA 2026 · Q26Database Management and Warehousingmsq1 mark
    Consider two relations r and s defined on the relational schemas R(A,B) and S(E,C), respectively. A is the primary key of R and E is a foreign key of S referencing A in R. Which of the following operations will NEVER violate the foreign key constraint?
    • A.
      Inserting records into relation r
      ✓
    • B.
      Deleting records from relation s
      ✓
    • C.
      Deleting records from relation r
    • D.
      Inserting records into relation s

    Answer: A, B

    Solution

    The constraint is: every value of in must exist as some in . - Inserting into (the referenced table) only adds possible targets. It never violates. - Deleting from (the referencing table) removes references. It never violates. - Deleting from can remove an value that some row of still refers to. It can violate. - Inserting into can add an value that does not exist in . It can violate. Answer: (A), (B).
    Open GATE DA 2026 Q26 · discuss this question →

Database Management and Warehousing: Relational Algebra — GATE DA PYQ (1)

  1. GATE DA 2026 · Q42Database Management and Warehousingmcq2 marks
    Consider the given relations , and . The relation has three columns , and . The relation has three columns , and . The relation has two columns and .
    X                 Y                 Z
    P   Q   R         P   Q   S         P   T
    P1  Q1  R1        P1  Q1  2         P1  T1
    P2  Q2  R2        P1  Q2  5         P3  T2
    P3  Q3  R2        P2  Q1  6         P4  T3
                      P3  Q3  1         P4  NULL
    Consider the relational algebra expression
    where denotes natural join operation. Which of the following options is the correct output for the given expression?
    • A.
      Two rows (P1, R1, 2) and (P1, R1, 5)
    • B.
      Three rows (P1, R1, 2), (P1, R1, 5) and (P2, R2, 6)
    • C.
      One row (P1, R1, 2)
    • D.
      Zero rows
      ✓

    Answer: D

    Solution

    Left part: joins on and gives and . The selection keeps only . Right part: joins on and gives , and . The selection keeps and . Final natural join: the two sides share . The left side has only and the right side has only , so nothing matches. The result is empty. Answer: (D) Zero rows.
    Open GATE DA 2026 Q42 · discuss this question →

Database Management and Warehousing: Relational Calculus — GATE DA PYQ (1)

  1. GATE DA 2026 · Q59Database Management and Warehousingnat2 marks
    Let there be two relations and as shown. has three columns , and . has two columns and .
    X                Y
    P   Q   R        P   S
    P1  Q1  R1       P1  10
    P2  Q2  R2       P1  15
    P3  Q3  R2       P2  20
                     P3  1
    Consider that the following tuple relational calculus expression is evaluated.
    The number of tuples that will be returned is __________ . (Answer in integer)

    Answer: 2 to 3

    Solution

    - is always true (take ). - So a tuple of is returned when has some row with the same and . Checking: - : has . Yes. - : has . Yes. - : has only , and is false. No. Two tuples of are returned. A relation is a set, so having two matching rows for does not duplicate the output. Answer: 2. (The official key accepts 2 to 3.)
    Open GATE DA 2026 Q59 · discuss this question →

Database Management and Warehousing: ER Model — GATE DA PYQ (1)

  1. GATE DA 2026 · Q61Database Management and Warehousingnat2 marks
    Consider an ER model with the entities E1(A11,A12,A13) and E2(A21,A22,A23), where, A11, A12, A13 are the attributes of E1, and A21, A22, A23 are the attributes of E2. Let A22 be a multi-valued attribute. A11 and A21 are the primary keys of E1 and E2, respectively. Let R12 be a many-to-many relationship between E1 and E2. Participation of both E1 and E2 in R12 is total. The minimum number of relations required to convert the ER model into relational model (assuming there is no other functional dependency) where each relation is in third normal form (3NF) is __________ . (Answer in integer)

    Answer: 4

    Solution

    - E1(A11, A12, A13): 1 relation. - E2(A21, A23): 1 relation. - The multi-valued attribute A22 needs its own relation E2_A22(A21, A22) to stay in 1NF/3NF: 1 relation. - A many-to-many relationship always needs a separate relation R12(A11, A21), even with total participation: 1 relation. Total . Answer: 4.
    Open GATE DA 2026 Q61 · discuss this question →

Take a Database Management and Warehousing chapter-wise test

Pick any chapters and attempt their PYQs with a timer in the GATE interface, with instant analysis — free.

Create free account →

More GATE DA PYQ subject-wise