Practice tests · GATE

GATE DBMS: 5 practice questions with answers

By the PrepMatic team · Updated · 4 min read

On this page
  1. What GATE tests in DBMS
  2. Practice questions
  3. Answers and explanations
  4. How to prepare DBMS
  5. Take the full topic test on PrepMatic

Databases is a section of the GATE CS paper and "Database Management and Warehousing" in DA. It rewards precise reasoning more than memorisation: given a set of functional dependencies, find the keys and the normal form; given a schedule, decide whether it is serialisable; given a query, say what SQL returns when NULLs are present. The five original questions below use those exact patterns.

What GATE tests in DBMS

Both papers list a database section in the 2027 syllabus, and CS names it simply "Databases". The topic list was revised, so check yours on the official syllabus page. The usual content is the ER and relational models, relational algebra and calculus, SQL, integrity constraints, normalisation, file organisation and indexing (B and B+ trees), and transactions with concurrency control; DA adds data warehousing. The real paper also has MSQ and NAT; all five below are MCQ.

Practice questions

Question 1

A relation R(A, B, C, D) has the functional dependencies AB → C, C → D and D → A. The number of candidate keys of R is:

  • A. 3
  • B. 4
  • C. 5
  • D. 6

Question 2

For the same relation R(A, B, C, D) with the functional dependencies AB → C, C → D and D → A, the highest normal form it satisfies is:

  • A. 1NF
  • B. 2NF
  • C. 3NF
  • D. BCNF

Question 3

The table Emp has 6 rows. The column sal is NULL in 2 of them. What does SELECT COUNT(*) FROM Emp WHERE sal > 100 OR sal <= 100; return?

  • A. 0
  • B. 4
  • C. 5
  • D. 6

Question 4

Consider the schedule S: r1(X); w2(X); r3(Y); w1(Y); w3(X), where ri and wi are reads and writes by transaction Ti. Which one of the following is true?

  • A. S is conflict serializable and equivalent to the serial order T1, T2, T3.
  • B. S is conflict serializable and equivalent to the serial order T3, T1, T2.
  • C. S is conflict serializable and equivalent to the serial order T2, T3, T1.
  • D. S is not conflict serializable.

Question 5

Relation R has 120 tuples and S has 80 tuples. The attribute S_id is the primary key of S, and in R it is a foreign key referencing S that is never NULL. The number of tuples in the natural join of R and S is:

  • A. 120
  • B. 80
  • C. 200
  • D. 9600

Answers and explanations

  1. A. B never appears on the right side of a dependency, so B must be in every key. Now test the closures. AB gives C, then D, then A, so AB is a key. BC gives D and then A, so BC is a key. BD gives A, then C through AB, so BD is a key. B alone has closure {B}, so no single attribute is a key, and every larger set containing B already contains one of these three pairs. The candidate keys are AB, BC and BD.
  2. C. Every attribute is part of some candidate key, so every attribute is prime. That satisfies 3NF, because each dependency's right side is prime or its left side is a superkey. BCNF fails because C → D has a left side (C) that is not a superkey. The relation is in 3NF but not in BCNF.
  3. B. For a row with NULL salary, both sal > 100 and sal <= 100 evaluate to UNKNOWN, and UNKNOWN OR UNKNOWN is UNKNOWN, so the row is not returned. Only the 4 rows with a non-NULL salary pass, because for each of them one of the two conditions is true. COUNT(*) counts rows, so the answer is 4, not 6.
  4. D. Conflicts: r1(X) before w2(X) gives T1 → T2; r1(X) before w3(X) gives T1 → T3; w2(X) before w3(X) gives T2 → T3; and r3(Y) before w1(Y) gives T3 → T1. The precedence graph has a cycle between T1 and T3, so S is not conflict serializable and no serial order is equivalent.
  5. A. Each tuple of R has a non-NULL S_id that matches exactly one tuple of S, because S_id is S's primary key. So every R tuple joins with exactly one S tuple and the result has 120 tuples. If the foreign key could be NULL, the count would be lower.

How to prepare DBMS

  • Master closure computation first. Attribute closure gives keys, tests dependency preservation and decides normal forms. Do ten problems and the method becomes automatic.
  • Use the normal-form checklist: 2NF removes partial dependencies on a key, 3NF needs a superkey on the left or a prime attribute on the right of each dependency, and BCNF needs a superkey on the left of every dependency.
  • Practise SQL by predicting results, not by writing queries. Pay special attention to NULL, GROUP BY with HAVING, nested subqueries, joins, and IN versus EXISTS.
  • Draw the precedence graph for every schedule. A cycle means not conflict serializable; no cycle gives a topological order. Then add view serializability, recoverability and two-phase locking.
  • Do index-size calculations with the stated block, pointer and key sizes, writing each step down. Remember that the join of R and S has between 0 and |R| × |S| tuples, and a foreign-key join keeps exactly the tuples of the referencing table.

The GATE CSE preparation guide shows where databases fit in the subject order, and DA aspirants should read the GATE Data Science and AI guide. Operating systems is a good next numerical subject.

Take the full topic test on PrepMatic

PrepMatic's topic tests run about 15 questions in 30 minutes, so you can try dependency, SQL and transaction questions in exam conditions. The free assessment shows your weakest subjects first.

Turn the GATE syllabus into a plan you can finish

Take a free GATE assessment on PrepMatic. It shows where you stand in your branch, turns the syllabus into a plan around the hours you actually have, and builds mock tests focused on your weak subjects.

Start free assessment →Free forever plan · No credit card · 2-minute setup

Related

More in GATE

← All practice tests