Skip to content

GATE CS Databases questions

Practise Databases questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.

Separate schema constraints from assumptions in the question. For SQL, trace joins and grouping; for normalisation, work from the stated functional dependencies.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2015DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
A file is organized so that the ordering of the data records is the same as or close to the ordering of data entries in some index. Then that index is called
Official PYQ2015DatabasesTuple Calculus and SQLMCQ · 1 mark
SELECT operation in SQL is equivalent to
Official PYQ2015DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider a simple checkpointing protocol and the following set of operations in the log. (start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7); (checkpoint); (start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2); If a crash happens now and the system tries to recover using both undo and redo …
Official PYQ2015DatabasesNormal FormsMCQ · 1 mark
Consider two relations R1(A,B)R_1(A,B) with the tuples (1,5),(3,7)(1,5), (3,7) and R2(A,C)=(1,7),(4,9)R_2(A,C) = (1,7),(4,9). Assume that R(A,B,C)R(A,B,C) is the full natural outer join of R1R_1 and R2R_2. Consider the following tuples of the form (A,B,C):(A,B,C): a=(1,5,null),b=(1,null,7),c=(3,null,9),d=(4,7,null),e=(1,5,7),a = (1,5,null), b=(1,null,7), c=(3,null,9), d=(4,7,null), e=(1,5,7), f=(3,7,null),g=(4,null,9).f=(3,7,null), g=(4,null,9). Which one of the …
Official PYQ2015DatabasesFile Organization and Indexing (B and B+ Trees)NAT · 1 mark
With reference to the B+B^+ tree index of order 11 shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query. "Get all records with a search key greater than or equal to 77 and less than 1515 " is ______.
Official PYQ2015DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following transaction involving two bank accounts xx and yy. read(x); x:=x-50; write (x); read(y); y:=y+50; write(y) The constraint that the sum of the accounts xx and yy should remain constant is that of
Official PYQ2015DatabasesFile Organization and Indexing (B and B+ Trees)NAT · 1 mark
Consider a B+B^+ tree in which the search key is 1212 bytes\text{bytes} long, block size is 10241024 bytes\text{bytes}, record pointer is 1010 bytes\text{bytes} long and the block pointer is 88 bytes\text{bytes} long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ______.
Official PYQ2015DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the partial Schedule SS involving two transactions T1T1 and T2T2. Only the read\textit{read} and the write\textit{write} operations have been shown. The read\textit{read} operation on data item PP is denoted by read(P)\textit{read(P)} and write\textit{write} operation on data item PP is denoted by write(P)\textit{write(P)}. …
Official PYQ2015DatabasesNormal FormsMCQ · 1 mark
Consider the relation X(P,Q,R,S,T,U)X(P,Q,R,S,T,U) with the following set of functional dependencies F={    {P,R}→{S,T},    {P,S,U}→{Q,R}  }F = \{ \\ \; \; \{P, R\} \rightarrow \{S, T\}, \\ \; \; \{P, S, U\} \rightarrow \{Q, R\} \\ \; \} Which of the following is the trivial functional dependency in F+F^+, where F+F^+ is closure to F?
Official PYQ2015DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relation Cinema(theater, address, capacity\textit{theater, address, capacity}) Which of the following options will be needed at the end of the SQL query SELECT P1.address FROM Cinema P1 such that it always finds the addresses of theaters with maximum capacity?
Official PYQ2014DatabasesTuple Calculus and SQLMCQ · 1 mark
Given the following schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary) departments(dept-id, dept-name, manager-id, location-id) You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700.\text{ID 1700.} You issue the following query: SQL>SELECT last-name, hire-date …
Official PYQ2014DatabasesNormal FormsMCQ · 1 mark
Given the following two statements: S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF\text{1NF, 2NF, 3NF} and BCNF.\text{BCNF}. S2: AB→C,D→E,E→CAB \to C, D \to E, E \to C is a minimal cover for the set of functional dependencies AB→C,D→E,AB→E,E→CAB \to C, D \to E, AB \to E, E \to C. Which one of the following is CORRECT?
Official PYQ2014DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x)r(x) and w(x)w(x) respectively. Which one of them is conflict serializable?
Official PYQ2014DatabasesTuple Calculus and SQLMCQ · 1 mark
Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table R(a,b,c)R(a,b,c) where aa and bb together form the primary key, the following is a valid table definition. CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R) Which …
Official PYQ2014DatabasesNormal FormsMCQ · 1 mark
Consider the relation scheme R=(E,F,G,H,I,J,K,L,M,N)R = (E, F, G, H, I, J, K, L, M, N) and the set of functional dependencies {{E,F}→{G},{F}→{I,J},{E,H}→{K,L},{K}→{M},{L}→{N}}\left\{ \{E, F \} \to \{G\}, \{F\} \to \{I, J\}, \{E, H\} \to \{K, L\}, \\ \{K\} \to \{M\}, \{L\} \to \{N\}\right\} on RR. What is the key for RR?
Official PYQ2014DatabasesTuple Calculus and SQLMCQ · 1 mark
SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below: select * from R where a in (select S.a from S)
Official PYQ2014DatabasesNormal FormsMCQ · 1 mark
Consider a join (relation algebra) between relations r(R)r(R) and s(S)s(S) using the nested loop method. There are 33 buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming size(r(R))<size(s(S)),\text{size}(r(R))<\text{size}(s(S)), the join will have fewer number of disk block accesses if
Official PYQ2014DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following schedule S of transactions T1,T2,T3,T4:T1, T2, T3, T4: …
Official PYQ2014DatabasesIntegrity ConstraintsNAT · 1 mark
Given an instance of the STUDENTS relation as shown as below …
Official PYQ2014DatabasesIntegrity ConstraintsNAT · 1 mark
The maximum number of superkeys for the relation schema R(E,F,G,H)R(E,F,G,H) with EE as the key is _____.