GATE CS Databases Previous Year Questions

60 solved GATE CS questions on Databases, drawn from 9 exam years and grouped by year. Every question shows the official answer and a step-by-step solution.

Want to practise this topic and ask follow-up questions? Explore Success Tracker.

Revision companion

Databases: reason from dependencies, rows, and schedules

Connect database definitions to small, checkable calculations. Start with stated constraints, not a pattern remembered from another question. Record the schema, dependencies, duplicate semantics, or transaction order before choosing a rule. These selected revision notes are a starting point, not a complete syllabus.

Our study notes and original examples support the PYQs below; they are not official exam questions or a replacement for the current syllabus.

Before you start

  • Sets, subsets, Cartesian products, and basic propositional logic.
  • Relations, tuples, attributes, and simple SELECT queries with joins.

Concepts to revise before solving

Attribute closure and candidate keys

Compute X+ by starting with X and repeatedly applying dependencies whose left sides are included, until nothing changes. X is a superkey when its closure contains every attribute; a candidate key additionally has no proper subset that is a superkey.

Check yourself: Can removing one attribute from your proposed key still determine the relation?

Normalization and decomposition

For every nontrivial dependency X → A, BCNF requires X to be a superkey. Third normal form also permits A to be prime, meaning it belongs to some candidate key. Check lossless join and dependency preservation separately; neither label substitutes for the other.

Check yourself: In a binary decomposition, does the shared attribute set determine either component?

Relational operations and SQL semantics

Relational algebra uses sets; SQL normally retains duplicates. Joins can multiply rows through multiple matches. WHERE retains only TRUE, so NULL comparisons need care. COUNT(column) ignores NULL values; COUNT(*) counts rows. DISTINCT changes multiplicity, not the join condition.

Check yourself: Can you enumerate the joined rows before grouping or counting them?

Conflict serializability

Create one precedence-graph vertex per transaction. Add an edge for ordered operations from different transactions on the same item when either writes. Acyclicity establishes conflict serializability; a topological order supplies an equivalent serial order. It does not establish recoverability.

Check yourself: Have you excluded read-read pairs and checked every shared data item?

Indexes and access cost

B+ trees support ordered traversal and ranges; hashing primarily supports equality lookup. An index lookup can still require data-page reads, especially for scattered matches. Calculate page accesses using index height, caching assumptions, and record layout rather than assuming an index eliminates I/O.

Check yourself: Could data-page access dominate the cost of this range query?

Mistakes to avoid

Inferring a dependency from a few sample rows.
A dependency constrains all legal instances; one sample can refute it but cannot establish it.
Calling every superset of a key a candidate key.
Such a set is a superkey. Demonstrate minimality before calling it a candidate key.
Assuming BCNF decomposition always preserves every dependency.
Check whether the union of projected dependencies implies the original dependencies; losslessness is different.

Original teaching example · not a PYQ

Work through the reasoning

Original mini-example: R(A, B, C) is in 1NF, with dependencies generated only by A → B and B → C. Find its candidate keys, highest normal form among 1NF–BCNF, and a lossless BCNF decomposition.

  1. A+ gains B, then C. B+ is {B, C}; C+ is {C}. No dependency introduces A, so every key contains A and the only candidate key is {A}.
  2. The single-attribute key has no partial dependency, so R satisfies 2NF. B → C violates 3NF and BCNF: B is not a superkey and C is not prime.
  3. Decompose into R1(A, B) and R2(B, C). Their intersection {B} determines R2, proving losslessness. A is R1's key and B is R2's key, so both satisfy BCNF. Both original dependencies remain locally enforceable.

Key: {A}. Highest normal form: 2NF. R1(A, B) and R2(B, C) are a lossless, dependency-preserving BCNF decomposition.

Try it before reading the answer

For the separate schedule r1(X), r2(X), w1(X), w2(X), with transaction subscripts, is conflict serializability satisfied?

Show answer and reasoning

No; the precedence graph contains a cycle.

r1(X) precedes w2(X), giving T1 → T2. r2(X) precedes w1(X), giving T2 → T1. These conflicting pairs form a cycle, excluding both possible serial orders.

Go deeper with free learning resources

Supplemental reading, not an official GATE reading list or an endorsement of these notes.

  • Database System Concepts: chapter slides

    Free supplemental slides from the textbook authors covering relational design, SQL, indexing, and transactions. Revisit the relevant chapter after attempting questions.

Apply this to the previous-year questions

Previous-year questions by year

This page shows 60 recent questions from the released archive, newest first. For older questions and complete papers, browse all GATE CS papers. Questions can carry more than one subject tag; counts are not marks weightage.

GATE CS 20268 questions

  1. Set 1 Q30Let P,Q,RP, Q, R and SS be the attributes of a relation in a relational schema. Let X⟶YX \longrightarrow Y indicate functional dependency in the context of a…MSQ · +1 marks · Easy
  2. Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?MSQ · +1 marks · Medium
  3. Set 1 Q43Consider a relational database schema with two relations R(P, Q) and S(X, Y). Let…MCQ · +2 marks · Medium
  4. Set 1 Q65Consider a relational database schema with a relation R(A, B, C, D). If {A,B}\{A, B\} and {A,C}\{A, C\} are the only two candidate keys of the relation RR, then…NAT · +2 marks · Medium
  5. Set 2 Q15In the context of DBMS, consider the two sets T and S given below. | T | S | |---|---| | I: Logical schema | L: Views | | II: Physical schema | M: File…MCQ · +1 marks · Easy
  6. Set 2 Q20Consider concurrent execution of two transactions T1T_1 and T2T_2 in a DBMS, both of which access a data object AA. For these two transactions to not conflict…MCQ · +1 marks · Easy
  7. Set 2 Q42In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied by F is…MCQ · +2 marks · Medium
  8. Set 2 Q46An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index.…MCQ · +2 marks · Medium

GATE CS 202510 questions

  1. Set 1 Q15A schedule of three database transactions T1,T2T_1, T_2, and T3T_3 is shown. Ri(A)R_i(A) and Wi(A)W_i(A) denote read and write of data item AA by transaction…MCQ · +1 marks · Medium
  2. Set 1 Q21Consider the following B+B^+ tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the B+B^+ tree. Which of the…MSQ · +1 marks · Medium
  3. Set 1 Q39Consider two relations describing teamsteams and playersplayers in a sports league: - teams(tid,tname)teams(tid, tname): tid,tnametid, tname are team-id and team-name, respectively -…MCQ · +2 marks · Easy
  4. Set 1 Q47Consider a relational schema team(name,city,owner)team(name, city, owner), with functional dependencies {name→city,name→owner}\{name \rightarrow city, name \rightarrow owner\}. The relation teamteam…MSQ · +2 marks · Medium
  5. Set 1 Q55Consider the following database tables of a sports league. player(pid,pname,age) coach(cid,cname) team(tid,tname,city,cid) members(pid,tid) An…NAT · +2 marks · Easy
  6. Set 2 Q27An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account AA attempted simultaneous transfers of Rs. 10000…MSQ · +1 marks · Medium
  7. Set 2 Q46Consider the following relational schema along with all the functional dependencies that hold on them. R1(A,B,C,D,E):{D→E,EA→B,EB→C}R1(A, B, C, D, E): \{D \to E, EA \to B, EB \to C\}…MSQ · +2 marks · Medium
  8. Set 2 Q53Consider the database transactions T1T_1 and T2T_2, and data items XX and YY. Which of the schedule(s) is/are conflict serializable? | Transaction T1T_1 |…MSQ · +2 marks · Medium
  9. Set 2 Q54Consider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname:…MSQ · +2 marks · Medium
  10. Set 2 Q57In a B+^+-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:…NAT · +2 marks · Medium

GATE CS 202412 questions

  1. Set 1 Q20Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one…MCQ · +1 marks · Easy
  2. Set 1 Q21In a B+B^+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?MCQ · +1 marks · Easy
  3. Set 1 Q22Which of the following statements about a relation R\mathbf{R} in first normal form (1NF) is/are TRUE ?MSQ · +1 marks · Medium
  4. Set 1 Q35Consider the following two relations, R(A,B) and S(A,C): Relation R | A | B | |---|---| | 10 | 20 | | 20 | 30 | | 30 | 40 | | 30 | 50 | | 50 | 95 |…NAT · +1 marks · Easy
  5. Set 1 Q44The symbol →\rightarrow indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?MSQ · +2 marks · Easy
  6. Set 1 Q46Consider the following read-write schedule SS over three transactions T1,T2T_1, T_2, and T3T_3, where the subscripts in the schedule indicate transaction IDs:…MSQ · +2 marks · Medium
  7. Set 2 Q19Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes…MCQ · +1 marks · Easy
  8. Set 2 Q20In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?MCQ · +1 marks · Easy
  9. Set 2 Q26Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?MSQ · +1 marks · Medium
  10. Set 2 Q27Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?MSQ · +1 marks · Medium
  11. Set 2 Q45The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra…MCQ · +2 marks · Hard
  12. Set 2 Q56A functional dependency F:X→YF: X \to Y is termed as a useful functional dependency if and only if it satisfies all the following three conditions: - XX is…NAT · +2 marks · Medium

GATE CS 20233 questions

  1. Set 1 Q16Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?MCQ · +1 marks · Easy
  2. Set 1 Q61Consider the following table named Student in a relational database. The primary key of this table is rollNum. | rollNum | name | gender | marks | |…NAT · +2 marks · Easy
  3. Set 1 Q62Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary…NAT · +2 marks · Medium

GATE CS 20225 questions

  1. Set 1 Q14In a relational data model, which one of the following statements is TRUE?MCQ · +1 marks · Easy
  2. Set 1 Q25Consider the following three relations in a relational database.…MSQ · +1 marks · Hard
  3. Set 1 Q31Consider a relation R(A, B, C, D, E) with the following three functional dependencies. AB → C; BC → D; C → E; The number…NAT · +1 marks · Medium
  4. Set 1 Q39Let Ri(z)R_i(z) and Wi(z)W_i(z) denote read and write operations on a data element zz by a transaction TiT_i, respectively. Consider the schedule SS with four…MCQ · +2 marks · Medium
  5. Set 1 Q56Consider the relational database with the following four schemas and their respective instances. Student(sNo, sName, dNo) Dept(dNo,…NAT · +2 marks · Medium

GATE CS 202111 questions

  1. Set 1 Q23Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions…MSQ · +1 marks · Medium
  2. Set 1 Q33A relation r(A,B)r(A, B) in a relational database has 1200 tuples. The attribute AA has integer values ranging from 6 to 20, and the attribute BB has integer…NAT · +1 marks · Medium
  3. Set 1 Q37The following relation records the age of 500 employees of a company, where empNoempNo (indicating the employee number) is the key: empAge(empNo,age)empAge(empNo, age)…MCQ · +2 marks · Medium
  4. Set 1 Q42Let ri(z)r_i(z) and wi(z)w_i(z) denote read and write operations respectively on a data item zz by a transaction TiT_i. Consider the following two schedules.…MCQ · +2 marks · Medium
  5. Set 1 Q43Consider the relation R(P, Q, S, T, X, Y, Z, W) with the following functional dependencies.…MCQ · +2 marks · Medium
  6. Set 1 Q57Consider a dynamic hashing approach for 4-bit integer keys: 1. There is a main hash table of size 4. 2. The 2 least significant bits of a key is used to index…MSQ · +2 marks · Hard
  7. Set 2 Q16Consider the following statements S1 and S2 about the relational data model: S1: A relation scheme can have at most one foreign key. S2: A foreign key in a…MCQ · +1 marks · Easy
  8. Set 2 Q31A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key RollNo.…NAT · +1 marks · Hard
  9. Set 2 Q41The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the…MCQ · +2 marks · Easy
  10. Set 2 Q42Let SS be the following schedule of operations of three transactions T1T_1, T2T_2 and T3T_3 in a relational database system:…MCQ · +2 marks · Medium
  11. Set 2 Q50Suppose the following functional dependencies hold on a relation UU with attributes P,Q,R,S,P, Q, R, S, and TT: P → QR RS → T Which of the…MSQ · +2 marks · Medium

GATE CS 20205 questions

  1. Set 1 Q23Consider a relational database containing the following schemas. Catalogue | sno | pno | cost | |---|---|---| | S1 | P1 | 150 | | S1 | P2 |…MCQ · +1 marks · Medium
  2. Set 1 Q24Which one of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram?MCQ · +1 marks · Easy
  3. Set 1 Q46Consider a relational table RR that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?MCQ · +2 marks · Medium
  4. Set 1 Q47Consider a schedule of transactions T1T_1 and T2T_2: | T1T_1 | RA | | | RC | | WD | | WB | Commit | | | ------ | ------ | ------ | ------ | ------ | ------ |…MCQ · +2 marks · Medium
  5. Set 1 Q64Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and…NAT · +2 marks · Medium

GATE CS 20195 questions

  1. Set 1 Q21Consider the following two statements about database transaction schedules: I. Strict two-phase locking protocol generates conflict serializable schedules that…MCQ · +1 marks · Medium
  2. Set 1 Q24Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?MCQ · +1 marks · Easy
  3. Set 1 Q42Let the set of functional dependencies F={QR→S,R→P,S→Q}F = \{QR \to S, R \to P, S \to Q\} hold on a relation schema X=(PQRS)X = (PQRS). XX is not in BCNF. Suppose XX is…MCQ · +2 marks · Medium
  4. Set 1 Q61A relational database contains two tables Student and Performance as shown below: Student | Roll no. | Student name | |----------|--------------| | 1 |…NAT · +2 marks · Medium
  5. Set 1 Q65Consider the following relations P(X,Y,Z), Q(X,Y,T) and R(Y,V). P | X | Y | Z | |---|---|---| | X1| Y1| Z1| | X1| Y1| Z2| | X2| Y2| Z2| | X2| Y4| Z4| **Q**…NAT · +2 marks · Medium

GATE CS 20181 question

  1. Set 1 Q21In an Entity-Relationship (ER) model, suppose RR is a many-to-one relationship from entity set E1 to entity set E2. Assume that E1 and E2 participate totally…MCQ · +1 marks · Easy

Other GATE CS topics

Continue learning with Success Tracker

Keep working on Databases

Reading a solution is a useful start. In Success Tracker, you can attempt questions yourself, review mistakes and return to the topics that need another pass.

AI-powered practice· Unlimited practice on eligible plans
PYQs with solutions
Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
Practice that adapts
Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
AI doubt support
Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.

Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.

This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.