Skip to content

GATE CS Tuple Calculus and SQL questions

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

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
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 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 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 PYQ2012DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relations A,BA, B and C:C: …
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 PYQ2011DatabasesTuple Calculus and SQLMCQ · 1 mark
Database table by name Loan_Records\text{Loan\_Records} is given below. …
Official PYQ2010DatabasesTuple Calculus and SQLMCQ · 1 mark
A relational schema for a train reservation database is given below. passenger(pid, pname, age) reservation(pid, class, tid) …
Official PYQ2009DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the following relational schema: Suppliers(sid:integer‾, sname:string, city:string, street:string)\text{Suppliers}(\underline{\text{sid:integer}},\text{ sname:string, city:string, street:string}) Parts(pid:integer‾, pname:string, color:string)\text{Parts}(\underline{\text{pid:integer}}, \text{ pname:string, color:string}) Catalog(sid:integer, pid:integer‾,cost:real)\text{Catalog}(\underline {\text{sid:integer, pid:integer}}, \text{cost:real}) Consider the following relational query on the …
Official PYQ2009DatabasesTuple Calculus and SQLMCQ · 1 mark
Let RR and SS be relational schemes such that R={a,b,c}R=\{a,b,c\} and S={c}.S=\{c\}. Now consider the following queries on the database: πR−S(r)−πR−S(πR−S(r)×s−πR−S,S(r))\pi_{R-S}(r) - \pi_{R-S} \left (\pi_{R-S} (r) \times s - \pi_{R-S,S}(r)\right ) …
Official PYQ2008DatabasesTuple Calculus and SQLMCQ · 1 mark
Which of the following tuple relational calculus expression(s) is/are equivalent to ∀t∈r(P(t))\forall t \in r \left(P\left(t\right)\right)? ¬∃t∈r(P(t))\neg \exists t \in r \left(P\left(t\right)\right) ∃t∉r(P(t))\exists t \notin r \left(P\left(t\right)\right) ¬∃t∈r(¬P(t))\neg \exists t \in r \left(\neg P\left(t\right)\right) ∃t∉r(¬P(t))\exists t \notin r \left(\neg P\left(t\right)\right)
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 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 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 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 …
Official PYQ2003DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the set of relations shown below and the SQL query that follows. Students: (Roll_number, Name, Date_of_birth) Courses: (Course_number, Course_name, Instructor) Grades: (Roll_number, Course_number, Grade) Select distinct Name from Students, Courses, Grades where Students.Roll_number=Grades.Roll_number and Courses.Instructor = 'Korth' and …
Official PYQ2002DatabasesTuple Calculus and SQLMCQ · 1 mark
With regards to the expressive power of the formal relational query languages, which of the following statements is true?