Practice tests · GATE
GATE DBMS: 5 practice questions with answers
On this page
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
- 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.
- 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.
- B. For a row with NULL salary, both
sal > 100andsal <= 100evaluate 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. - 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.
- 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
INversusEXISTS. - 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 setupRelated
- GATE operating systems practiceFive GATE-style operating system MCQs on SRTF scheduling, deadlock, LRU page replacement, effective access time and SCAN disk scheduling, with traced solutions.
- GATE algorithms practiceFive GATE-style algorithm MCQs on recurrences, Dijkstra, 0/1 knapsack, minimum comparisons and loop analysis, with worked solutions and a preparation plan.
- GATE data structures practiceFive GATE-style data structures MCQs on postfix evaluation, BST deletion, heap insertion, C pointer arithmetic and hashing, with traced solutions for CS and DA.
- GATE CSE preparationPlan GATE CS 2027: the revised syllabus section by section, the order to study the nine core subjects, standard books and a 26-week plan from first pass to mocks.
- GATE Data Science and AIThe GATE DA 2027 paper: seven syllabus sections for 85 marks, who should pick DA over CS, Python and maths priorities, books, and a six-month order of study.
More in GATE
- GATE differential equations practiceFive GATE-level differential equation MCQs on linear ODEs, repeated roots, particular integrals, Laplace transforms and the wave equation, with solutions.
- GATE DA probability practiceFive GATE Data Science and AI probability and statistics MCQs on covariance, confidence intervals, the z-test, the central limit theorem and chi-squared tests.
- GATE digital logic practiceFive GATE-style digital logic MCQs on K-map minimisation, two's complement overflow, counter modulus, multiplexer design and clock frequency, with answers.
- GATE control systems practiceFive GATE-style control systems MCQs on damping ratio, Routh stability, steady-state error, root locus breakaway points and gain margin for EE and EC.
- GATE EC digital circuits practiceFive GATE EC digital circuits MCQs on DAC output, memory expansion, Johnson counters, hazard removal and address decoding, with worked solutions.
- GATE computer organization practiceFive GATE-style computer organization MCQs on cache tag bits, pipeline CPI, expanding opcodes, DMA cycle stealing and memory access time, with worked answers.
- GATE electrical machines practiceFive GATE EE electrical machines MCQs on transformer efficiency, DC motor speed, induction motor losses, alternator regulation and autotransformers.
- GATE computer networks practiceFive GATE-style computer networks MCQs on subnetting, CSMA/CD frame size, Go-Back-N, TCP congestion control and IP fragmentation, with step-by-step solutions.