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 PYQ2014DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relational schema: employee (empId,empName,empDept) customer (custId,custName,salesRepId,rating) salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return? SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId …
Official PYQ2014DatabasesNormal FormsMCQ · 1 mark
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation. employee (empId, empName, empAge) dependent (depId, eId, depName, depAge) Consider the following relational algebra query: …
Official PYQ2014DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the transactions T1,T2, and T3T1, T2, \:\text{and} \:T3 and the schedules S1 and S2S1 \:\text{and} \:S2 given below. T1:r1(X);r1(Z);w1(X);w1(Z)T1: r1(X); r1(Z); w1(X); w1(Z) T2:r2(Y);r2(Z);w2(Z)T2: r2(Y); r2(Z); w2(Z) T3:r3(Y);r3(X);w3(Y)T3: r3(Y); r3(X); w3(Y) S1:r1(X);r3(Y);r3(X);r2(Y);r2(Z);w3(Y);w2(Z);r1(Z);w1(X);w1(Z)S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2:r1(X);r3(Y);r2(Y);r3(X);r1(Z);r2(Z);w3(Y);w1(X);w2(Z);w1(Z)S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z) …
Official PYQ2014DatabasesIntegrity ConstraintsMCQ · 1 mark
A prime attribute of a relation scheme RR is an attribute that appears
Official PYQ2014DatabasesRelational Model: Relational AlgebraMCQ · 1 mark
What is the optimized version of the relation algebra expression πA1(πA2(σF1(σF2(r))))\pi_{A1}(\pi_{A2}(\sigma_{F1}(\sigma_{F2}(r)))), where A1,A2A1, A2 are sets of attributes in rr with A1⊂A2A1 \subset A2 and F1,F2F1,F2 are Boolean expressions based on the attributes in rr?
Official PYQ2013DatabasesNormal FormsMCQ · 1 mark
Relation RR has eight attributes ABCDEFGH\text{ABCDEFGH}. Fields of RR contain only atomic values. FF= CH→G, A→BC, B→CFH, E→A, F→EG\text{{CH→G, A→BC, B→CFH, E→A, F→EG}} is a set of functional dependencies (FDs)(FDs) so that F+F^+ is exactly the set of FDsFDs that hold for RR. How many candidate keys does the relation RR have?
Official PYQ2013DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relational schema. Students(rollno: integer, sname: string) Courses(courseno: integer, cname: string) Registration(rollno: integer, courseno: integer, percent: real) Which of the following queries are equivalent to this query in English? “Find the distinct names of all students who score more than 90%90\% in the course numbered 107” …
Official PYQ2013DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
An index is clustered, if
Official PYQ2012DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relations A,BA, B and C:C: …
Official PYQ2012DatabasesRelational Model: Relational AlgebraMCQ · 1 mark
Consider the following relations A,BA, B and C:C: …
Official PYQ2012DatabasesRelational Model: Relational AlgebraMCQ · 1 mark
Suppose R1(A‾,B)R_{1} (\underline{A}, B) and R2(C‾,D)R_{2} (\underline{C}, D) are two relation schemas. Let r1r_{1} and r2r_{2} be the corresponding relation instances. BB is a foreign key that refers to CC in R2R_{2}. If data in r1r_{1} and r2r_{2} satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
Official PYQ2012DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following transactions with data items PP and QQ initialized to zero: …
Official PYQ2012DatabasesTuple Calculus and SQLMCQ · 1 mark
Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP BY clause …
Official PYQ2012DatabasesER-modelMCQ · 1 mark
Given the basic ER and relational models, which of the following is INCORRECT?
Official PYQ2012DatabasesNormal FormsMCQ · 1 mark
Which of the following is TRUE?
Official PYQ2011DatabasesTuple Calculus and SQLMCQ · 1 mark
Database table by name Loan_Records\text{Loan\_Records} is given below. …
Official PYQ2011DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
Consider a relational table rr with sufficient number of records, having attributes A1,A2,…,AnA_1, A_2, \dots ,A_n and let 1≤p≤n1 \leq p \leq n. Two queries Q1Q1 and Q2Q2 are given below. Q1:πA1,…,Ap(σAp=c(r))Q1: \pi_{A_1, \dots ,A_p} \left(\sigma_{A_p=c}\left(r\right)\right) where cc is a constant …
Official PYQ2011DatabasesNormal FormsMCQ · 1 mark
Consider a database table T containing two columns X\text{X} and Y\text{Y} each of type integer\text{integer}. After the creation of the table, one record (X=1, Y=1)\text{(X=1, Y=1)} is inserted in the table. Let MX\text{MX} and MY\text{MY} denote the respective maximum values of X\text{X} and Y\text{Y} among all records in the table at any point in …
Official PYQ2011DatabasesNormal FormsMCQ · 1 mark
Consider a relational table with a single record for each registered student with the following attributes: Registration_Num:\text{Registration\_Num:} Unique registration number for each registered student UID:\text{UID:} Unique identity number, unique at the national level for each citizen BankAccount_Num:\text{BankAccount\_Num:} Unique account number at the bank. A student can …
Official PYQ2010DatabasesNormal FormsMCQ · 1 mark
The following functional dependencies hold for relations R(A,B,C)R(A, B, C) and S(B,D,E).S(B, D, E). B→AB \to A A→CA \to C The relation RR contains 200200 tuples and the relation SS contains 100100 tuples. What is the maximum number of tuples possible in the natural join R⋈SR \bowtie S?