GATE Databases: Relational Model: Relational Algebra, Tuple Calculus, SQL – Previous Year Questions
48 GATE previous year questions on Relational Model: Relational Algebra, Tuple Calculus, SQL (Databases, Computer Science) with answers and explanations, from every paper.
48 questions worth 82 marks in all (14 1-mark, 34 2-mark). Asked between 2007 and 2026, so you can see how the topic has been tested over time.
- GATE 2007 CS Q59 – Relations studInfo(studId, name, sex), key studId, and enroll(studId, courseId), key(studId, courseId), record students and courses. Every course has…
- GATE 2007 CS Q60 – employee(name, sex, supervisorName) has key name; supervisorName names an immediate supervisor. What does \e.name employee(e) x[ employee(x)…
- GATE 2007 CS Q61 – employee(empId, name, department, salary) has more than one employee in department5. We want employees paid more than anyone in department5. Which is…
- GATE 2008 CS Q15 – Which tuple-relational-calculus expression is equivalent to t r(P(t))? I. t r(P(t)) II. t r(P(t)) III. t r( P(t)) IV. t r( P(t))
- GATE 2008 CS Q68 – Relations R(P, Q, R1, R2, R3), S(P, Q, S1, S2) both have key P, Q. Which queries are equivalent? I. P(R S) II. P(R) P(S) III. P( P,Q(R) P,Q(S)) IV. P(…
- GATE 2009 CS Q45 – Let schemas R=a, b, c, S=c. Which queries are equivalent? I. R-S(r)- R-S(( R-S(r) s)- R-S,S(r)) II. \t t R-S(r) u s( v r(u=v[S] t=v[R-S]))\ III. \t t…
- GATE 2009 CS Q55 – Relations: Suppliers(sid:integer, sname:string, city:string, street:string), Parts(pid:integer, pname:string, color:string), Catalog(sid:integer,…
- GATE 2021 CS (CS2) Q41 – emp(empId,name,gender,salary,deptId) has key empId, and each employee belongs to one department. What does this query count for each department? It…
- GATE 2015 CS (CS3) Q29 – Cinema(theater,address,capacity) stores theaters. Complete the query to always return addresses of maximum-capacity theaters, assuming non-NULL…
- GATE 2015 CS (CS2) Q40 – R1(A,B)=(1,5),(3,7) and R2(A,C)=(1,7),(4,9). Let R be their full natural outer join. Candidate tuples are a=(1,5,NULL), b=(1,NULL,7), c=(3,NULL,9),…
- GATE 2010 CS Q29 – Passenger(pid,pname,age) has (0,Sachin,65),(1,Rahul,66),(2,Sourav,67),(3,Anil,69). Reservation(pid,class,tid) has…
- GATE 2010 CS Q53 – Relations R(A,B,C) and S(B,D,E) satisfy B→A and A→C. R has 200 tuples and S has 100. What is the maximum tuple count in R natural-join S?
- GATE 2011 CS Q42 – An integer table T(X,Y) initially contains (1,1). Let MX,MY be current maxima of its columns. Insert (MX+1,2MY+1), recomputing maxima each time, 128…
- GATE 2011 CS Q56 – Loan Records(Borrower,Bank Manager,Loan Amount) contains (Ramesh,Sunderajan,10000),(Suresh,Ramgopal,5000),(Mahesh,Sunderajan,7000). Find the output.
- GATE 2013 CS Q45 – Schemas: Students(rollno,sname), Courses(courseno,cname), Registration(rollno,courseno,percent). Which queries give distinct student names scoring >90…
- GATE 2012 CS Q25 – Which SQL assertions are true? P: HAVING can occur without GROUP BY. Q: HAVING requires GROUP BY. R: Every GROUP BY attribute must appear in SELECT.…
- GATE 2012 CS Q60 – A(Id,Name,Age)=(12,Arun,60),(15,Shreya,24),(99,Rohit,11); B(Id,Name,Age)=(15,Shreya,24),(25,Hari,40),(98,Rohit,20),(99,Rohit,11);…
- GATE 2012 CS Q61 – A(Id,Name,Age)=(12,Arun,60),(15,Shreya,24),(99,Rohit,11); B(Id,Name,Age)=(15,Shreya,24),(25,Hari,40),(98,Rohit,20),(99,Rohit,11);…
- GATE 2017 CS (CS2) Q56 – top scorer(player,country,goals) contains Klose/Germany/16, Ronaldo/Brazil/15, G Müller/Germany/14, Fontaine/France/13, Pelé/Brazil/12,…
- GATE 2016 CS (CS2) Q62 – Table water schemes has (scheme no,district name,capacity): (1,Ajmer,20), (1,Bikaner,10), (2,Bikaner,10), (3,Bikaner,20), (1,Churu,10), (2,Churu,20),…
- GATE 2014 CS (CS3) Q31 – Optimize A 1( A 2( F 1( F 2(r)))), where A 1 A 2 are attribute sets of r and F 1,F 2 are Boolean expressions on its attributes.
- GATE 2014 CS (CS3) Q40 – Schemas: employee(empId,empName,empAge), dependent(depId,eId,depName,depAge). eId references empId; every employee has at least one associated…
- GATE 2014 CS (CS3) Q64 – Schemas: employee(empId,empName,empDept), customer(custId,custName,salesRepId,rating). salesRepId references employee.empId. Each employee makes a…
- GATE 2014 CS (CS2) Q64 – SQL allows duplicate tuples and multiplicities in joins. Which query always gives the same result as “select * from R where a in (select S.a from S)”?
- GATE 2014 CS (CS1) Q64 – Schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary); departments(dept-id, dept-name, manager-id, location-id). To display…
- GATE 2017 CS (CS1) Q33 – Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given…
- GATE 2017 CS (CS1) Q51 – Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be…
- GATE 2017 CS (CS1) Q56 – Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below. StudentName CourseName…
- GATE 2015 CS (CS1) Q31 – SELECT operation in SQL is equivalent to
- GATE 2015 CS (CS1) Q61 – Consider the following relations: Student Roll No Student Name --- --- 1 Raj 2 Rohit 3 Raj Performance Roll No Course Marks --- --- --- 1 Math 80 1…
- GATE 2018 CS Q22 – Consider the following two tables and four queries in SQL. Book (isbn, bname), Stock (isbn, copies) Query 1: SELECT B.isbn, S.copies FROM Book B INNER…
- GATE 2018 CS Q51 – Consider the relations r(A,B) and s(B,C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query Q:\ r( B<5(s)) Let…
- GATE 2019 CS Q61 – A relational database contains two tables Student and Performance as shown below: Roll no. Student name --- --- 1 Amit 2 Priya 3 Vinit 4 Rohan 5 Smita…
- GATE 2019 CS Q65 – Consider the following relations P(X,Y,Z), Q(X,Y,T) and R(Y,V). X Y Z --- --- --- X1 Y1 Z1 X1 Y1 Z2 X2 Y2 Z2 X2 Y4 Z4 (relation P) X Y T --- --- ---…
- GATE 2026 CS (CS1) Q30 – Let P, Q, R and S be the attributes of a relation in a relational schema. Let X Y indicate functional dependency in the context of a relational…
- GATE 2026 CS (CS1) Q43 – Consider a relational database schema with two relations R(P, Q) and S(X, Y). Let E = \ u v w \, u, v R v, w S\ be a tuple relational calculus…
- GATE 2025 CS (CS2) Q54 – Consider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname:…
- GATE 2025 CS (CS1) Q39 – Consider two relations describing teams and players in a sports league: - teams(tid, tname): tid, tname are team-id and team-name, respectively -…
- GATE 2025 CS (CS1) Q55 – Consider the following database tables of a sports league. player(pid,pname,age) coach(cid,cname) team(tid,tname,city,cid) members(pid,tid) An…
- GATE 2024 CS (CS2) Q45 – The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra…
- GATE 2024 CS (CS1) Q35 – Consider two relations R(A,B) with tuples (10,20),(20,30),(30,40),(30,50),(50,95) and S(A,C) with tuples (10,90),(30,45),(40,80). The total number of…
- GATE 2023 CS Q16 – Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?
- GATE 2023 CS Q61 – Consider the following table named Student in a relational database. The primary key of this table is rollNum. Student(rollNum, name, gender, marks):…
- GATE 2022 CS Q25 – Consider the following three relations in a relational database. Employee(eId, Name), Brand(bId, bName), Own(eId, bId) Which of the following…
- GATE 2022 CS Q56 – Consider the relational database with the following four schemas and their respective instances. Student(sNo, sName, dNo): (S01, James, D01), (S02,…
- GATE 2021 CS (CS1) Q33 – A relation r(A, B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer…
- GATE 2021 CS (CS1) Q37 – The following relation records the age of 500 employees of a company, where empNo (indicating the employee number) is the key: empAge(empNo, age).…
- GATE 2020 CS Q23 – Consider a relational database containing the following schemas. Catalogue(sno, pno, cost): (S1,P1,150), (S1,P2,50), (S1,P3,100), (S2,P4,200),…