Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

SQL

GATE CSE & IT · Database Management Systems - SQL · 1998-2025

36
PYQs
86%
keyed
0
elite explanations
19
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2025 Q54

Consider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname: string, credits: integer) Enrolled (...

mediumanswer key
2025 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 instance of the table and an S...

mediumanswer key
2025 PYQ

Consider the following relational schema: Students ($$\mathrm{\underline {rollno:integer}}$$, name: string, age: integer, cgpa: real) Courses ($$\mathrm{\underline {courseno:intege...

mediumanswer keybasic explanation
2023 PYQ

Consider the following table named Student in a relational database. The primary key of this table is rollNum. Student rollNum name gender marks 1 Naman M 62 2 Aliya F 70 3 Aliya F...

easybasic explanation
2021 PYQ

The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is a...

easyanswer keybasic explanation
2018 PYQ

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 JOIN Stock S ON B.isbn =...

easyanswer key
2016 PYQ

Consider the following database table named $$water$$_$$schemes :$$ water_schemes scheme_no district_name capacity 1 Ajmer 20 1 Bikaner 10 2 Bikaner 10 3 Bikaner 20 1 Churu 10 2 Ch...

medium
2015 PYQ

Consider the following relation: Student Roll_No Student_Name 1 Raj 2 Rohit 3 Raj Performance Roll_No Course Marks 1 Math 80 1 English 70 2 Math 75 3 English 80 2 Physics 65 3 Math...

medium
2015 PYQ

Consider the following relation $$\,\,\,\,\,\,\,\,$$ Cinema(theater, address, capacity) Which of the following options will be needed at the end of the $$SQL$$ query $$\,\,\,\,\,\,...

easyanswer key
2015 PYQ

SELECT operation in SQL is equivalent to

easyanswer key
2014 PYQ

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) where a and b together fo...

mediumanswer key
2014 PYQ

Consider the following relational schema: employee ( empId, empName, empDept ) customer ( custId, custName, salesRepId, rating) SalesRepId is a foreign key referring to empId of th...

mediumanswer key
2014 PYQ

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 la...

mediumanswer key
2014 PYQ

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 an...

mediumanswer key
2013 PYQ

Consider the following relational schema. Students( rollno: integer, sname: string) Courses( courseno: integer, cname: string) Registration( rollno: integer, courseno: integer, per...

mediumanswer key
2011 PYQ

Database table by name Loan_Records is given below. Borrower Bank_Manager Loan_Amount Ramesh Sunderajan 10000.00 Suresh Ramgopal 5000.00 Mahesh Sunderajan 7000.00 What is the outpu...

mediumanswer key
2011 PYQ

Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X = 1, Y = 1) is inserted in the table. Let MX and MY...

easyanswer key
2010 PYQ

A relational schema for a train reservation database is given below: Passenger ( pid, pname, age) Reservation (pid, cass, tid) Table: Passenger pid pname age 0 'Sachin' 65 1 'Rahul...

mediumanswer key
2008 PYQ

Consider The Following Relational Scheme Student ( school-id, sch-roll-no , sname, saddress) School ( school-id , sch-name, sch-address, sch-phone) Enrolment ( school-id, sch-roll-...

mediumanswer key
2007 PYQ

Consider the table employee(empId, name, department, salary) and the two queries Q 1 , Q 2 below. Assuming that department 5 has more than one employee, and we want to find the emp...

mediumanswer key
2006 PYQ

Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The...

hardanswer key
2006 PYQ

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...

mediumanswer key
2006 PYQ

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are Did and cid respectively and the records are stored in ascendi...

mediumanswer key
2005 PYQ

A table ‘student’ with schema (roll, name, hostel, marks), and another table ‘hobby’ with schema (roll, hobbyname) contains records as shown below: Table: student Roll Name Hostel...

mediumanswer key
2005 PYQ

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 t...

mediumanswer key
2005 PYQ

In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the information. Amongst these, the following two tables hold...

mediumanswer key
2004 PYQ

A relational database contains two table student and department in which student table has columns roll_no, name and dept_id and department table has columns dept_id and detp_name...

easyanswer key
2004 PYQ

Consider two tables in a relational database with columns and rows as follows: Table: Student Roll_no Name Dept_id 1 ABC 1 2 DEF 1 3 GHI 2 4 JKL 3 Table: Department Dept_id Dept_na...

mediumanswer key
2004 PYQ

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...

easyanswer key
2003 PYQ

Consider the following SQL query: Select distinct a 1 , a 2 , ..., a n From r 1 , r 2 , ..., r m Where P; For an arbitrary predicate P, this query is equivalent to which of the fol...

easyanswer key
2003 PYQ

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: (Ro...

easyanswer key
2000 PYQ

In SQL, relations can contain null values, and comparisons with null values are treated as unknown. Suppose all comparisons with a null value are treated as false. Which of the fol...

mediumanswer key
2000 PYQ

Given relations r( w, x ) and s( y, z ), the result of select distinct w,x from r, s; is guaranteed to be same as r, provided

easyanswer key
1999 PYQ

Consider the set of relations EMP (Employee-no, Dept-no, Employee-name, Salary) DEPT (Dept-no, Dept-name, Location) Write an SQL query to: (a) Find all employee names who work in d...

easy
1999 PYQ

Which of the following is/are correct?

easyanswer key
1998 PYQ

Suppose we have a database consisting of the following three relations. FREQUENTS (student, parlor) giving the parlors each student visits. SERVES (parlor, ice-cream) indicating wh...

medium