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 PYQ2007DatabasesNormal FormsMCQ · 1 mark
Which one of the following statements is FALSE\text{FALSE}?
Official PYQ2007DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the table employee(empId, name, department, salary) and the two queries Q1, Q2Q_1, \, Q_2 below. Assuming that department 55 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5,5, which one of the statements is TRUE for any arbitrary employee table? Q1:Q_1: Select e.empId From …
Official PYQ2007DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce? …
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts 6000,7000,8000,90006000, 7000, 8000, 9000 and 1000010000 were each paid by 20%20\% of the students. Consider these …
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries: Query1: select student from enrolled where student in (select student from paid) Query2: …
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation account (customer, balance) where the customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1.1. Ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 11 and …
Official PYQ2006DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following log sequence of two transactions on a bank account, with initial balance 12000,12000, that transfer 20002000 to a mortgage payment and then apply a 5%5\% interest. T1 start T1 B old =12000=12000 new =10000=10000 T1 M old =0=0 new =2000=2000 T1 commit T2 start T2 B old =10000=10000 new =10500=10500 T2 commit Suppose the database system crashes …
Official PYQ2005DatabasesIntegrity ConstraintsMCQ · 1 mark
Consider a relation scheme R=(A,B,C,D,E,H)R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A→BA \rightarrow B, BC→DBC \rightarrow D, E→CE \rightarrow C, D→AD \rightarrow A}. What are the candidate keys R?
Official PYQ2005DatabasesTuple Calculus and SQLMCQ · 1 mark
The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list? select title from book as B where (select count(*) from book as T where T.price>B.price) < 5
Official PYQ2005DatabasesIntegrity ConstraintsMCQ · 1 mark
The following table has two attributes AA and CC where AA is the primary key and CC is the foreign key referencing AA with on-delete cascade. …
Official PYQ2005DatabasesER-modelMCQ · 1 mark
Let E1E_1 and E2E_2 be two entities in an E/RE/R diagram with simple-valued attributes. R1R_1 and R2R_2 are two relationships between E1E_1 and E2E_2, where R1R_1 is one-to-many and R2R_2 is many-to-many. R1R_1 and R2R_2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in …
Official PYQ2005DatabasesRelational Model: Relational AlgebraMCQ · 1 mark
Let r be a relation instance with schema R = (A, B, C, D). We define r1=πA,B,C(R)r_1 = \pi_{A, B, C} (R) and r2=πA,D(r)r_2=\pi_{A, D} (r). Let s=r1 ∗ r2s =r_1 \: * \: r_2 where ∗* denotes natural join. Given that the decomposition of rr into r1r_1 and r2r_2 is lossy, which one of the following is TRUE?
Official PYQ2005DatabasesNormal FormsMCQ · 1 mark
Which one of the following statements about normal forms is FALSE?\text{FALSE}?
Official PYQ2005DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
Which of the following is a key factor for preferring B+B^+-trees to binary search trees for indexing database relations?
Official PYQ2004DatabasesTuple Calculus and SQLMCQ · 1 mark
The employee information in a company is stored in the relation Employee (name, sex, salary, deptName) Consider the following SQL query Select deptName From Employee Where sex = ‘M’ Group by deptName Having avg(salary) > (select avg (salary) from Employee) It returns the names of the department in which
Official PYQ2004DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
The order of an internal node in a B+B+ tree index is the maximum number of children it can have. Suppose that a child pointer takes 66 bytes, the search field value takes 1414 bytes, and the block size is 512512 bytes. What is the order of the internal node?
Official PYQ2004DatabasesNormal FormsMCQ · 1 mark
Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce? (Note: ρ\rho is the rename operator). …
Official PYQ2004DatabasesNormal FormsMCQ · 1 mark
The relation scheme Student Performance (name, courseNo, rollNo, grade)\text{Student Performance (name, courseNo, rollNo, grade)} has the following functional dependencies: name, courseNo, →\rightarrow grade rollNo, courseNo →\rightarrow grade name →\rightarrow rollNo rollNo →\rightarrow name The highest normal form of this relation scheme is
Official PYQ2004DatabasesRelational Model: Relational AlgebraMCQ · 1 mark
Consider the following relation schema pertaining to a students database: Students (rollno, name, address) Enroll (rollno, courseno, coursename) where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are 120120 and 88 respectively. What are the maximum and minimum number of tuples that can be present in …
Official PYQ2004DatabasesTuple Calculus and SQLMCQ · 1 mark
Let R1(A‾,B,C)R_1 \left(\underline{A}, B, C\right) and R2(D‾,E)R_2\left(\underline{D}, E \right) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1R_1 referring to R2R_2. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1r_1 and r2r_2. Which …