My Cart
Your Cart 0

    Your cart is empty.

  • Total (Amount) ₹0.00
Previous year question hub

Relational Models, Algebra and SQL - Databases - Computer Science & Information Technology Previous Year Questions

Practice Relational Models, Algebra and SQL - Databases - Computer Science & Information Technology previous year questions organised from real papers, with year-wise coverage and clear topic navigation.

23Papers
14Years
37Questions
1Topics

Relational Models, Algebra and SQL question pattern

Every graph below is calculated only from this selection.

Questions by year

Year-wise coverage for Relational Models, Algebra and SQL. Each bar uses a separate theme-derived color.

Difficulty distribution

How the classified questions are distributed by difficulty.

Medium 22 59.5%
Easy 14 37.8%
Hard 1 2.7%

Question type distribution

MCQ, numerical, multiple-select and other formats found in these papers.

MCQ 24 64.9%
Numerical Answer Type (NAT) 9 24.3%
MSQ 4 10.8%

Subject weightage

Top subjects by unique question coverage.

Computer Science & Information Technology
37 Qs

Most asked topics

Top topics across the included previous year papers.

Databases
37 Qs

Subtopic coverage

Top subtopics inside this exact selection.

Relational Models, Algebra and SQL
37 Qs

Paper coverage

Question coverage for the most populated papers. Every active PYP paper remains listed below.

Computer Science and Information Technology (CS) 2026
1 Qs
Computer Science and Information Technology (CS) 2026
1 Qs
Computer Science & Information Technology (CS) 2025 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2025 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2024 [Session 1]
2 Qs
Computer Science & Information Technology (CS) 2024 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2023 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2022 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2021 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2021 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2020 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2019 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2018 [Session 2]
3 Qs
Computer Science & Information Technology (CS) 2017 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2016 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2016 [Session 2]
1 Qs
Computer Science & Information Technology (CS) 2014 [Session 3]
3 Qs
Computer Science & Information Technology (CS) 2014 [Session 2]
2 Qs
Computer Science & Information Technology (CS) 2014 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2013 [Session 4]
2 Qs
Computer Science & Information Technology (CS) 2013 [Session 1]
1 Qs
Computer Science & Information Technology (CS) 2013 [Session 3]
1 Qs
Computer Science & Information Technology (CS) 2009
1 Qs

Included previous year papers

Newest papers appear first. Sort by year, question coverage or name.

PaperYear / sessionQuestions in this viewOpen
Computer Science and Information Technology (CS) 202620261View paper
Computer Science and Information Technology (CS) 202620261View paper
Computer Science & Information Technology (CS) 2025 [Session 1]20252View paper
Computer Science & Information Technology (CS) 2025 [Session 2]20251View paper
Computer Science & Information Technology (CS) 2024 [Session 1]20242View paper
Computer Science & Information Technology (CS) 2024 [Session 2]20242View paper
Computer Science & Information Technology (CS) 2023 [Session 2]20232View paper
Computer Science & Information Technology (CS) 2022 [Session 2]20222View paper
Computer Science & Information Technology (CS) 2021 [Session 1]20211View paper
Computer Science & Information Technology (CS) 2021 [Session 2]20211View paper
Computer Science & Information Technology (CS) 2020 [Session 2]20202View paper
Computer Science & Information Technology (CS) 2019 [Session 2]20192View paper
Computer Science & Information Technology (CS) 2018 [Session 2]20183View paper
Computer Science & Information Technology (CS) 2017 [Session 2]20172View paper
Computer Science & Information Technology (CS) 2016 [Session 1]20161View paper
Computer Science & Information Technology (CS) 2016 [Session 2]20161View paper
Computer Science & Information Technology (CS) 2014 [Session 1]20141View paper
Computer Science & Information Technology (CS) 2014 [Session 2]20142View paper
Computer Science & Information Technology (CS) 2014 [Session 3]20143View paper
Computer Science & Information Technology (CS) 2013 [Session 1]20131View paper
Computer Science & Information Technology (CS) 2013 [Session 3]20131View paper
Computer Science & Information Technology (CS) 2013 [Session 4]20132View paper
Computer Science & Information Technology (CS) 200920091View paper

All Relational Models, Algebra and SQL previous year questions

Practice every matching question in batches of 20, with every available option.

1
2009 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2009
Consider the following relational query on the above database :
SELECT S.sname
FROM Suppliers S
WHERE S.sid NOT IN ( SELECT C.sid
FROM Catalog C
WHERE C.pid NOT IN ( SELECT P.pid
FROM Parts P
WHERE P.color <> 'blue'))
Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query ?
Open complete paper
2
2013 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2013 [Session 1]
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% in the course numbered 107” (I) SELECT DISTINCT S.sname FROM Students as S, Registration as R WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent > 90 (II) Π_{sname}(σ_{courseno=107 ∧ percent>90}(Registration ⋈ Students)) (III) {T | ∃S∈Students, ∃R∈Registration ( S.rollno=R.rollno ∧ R.courseno=107 ∧ R.percent>90 ∧ T.sname=S.sname)} (IV) { | ∃S_N∃R_P ( ∈ Students ∧ ∈ Registration ∧ R_P>90)}
Open complete paper
3
2013 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2013 [Session 3]
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% in the course numbered 107” (I) SELECT DISTINCT S.sname FROM Students as S, Registration as R WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent>90 (II) Π_{sname}(σ_{courseno=107 ∧ percent>90}(Registration ⋈ Students)) (III) {T | ∃S ∈ Students, ∃R ∈ Registration ( S.rollno=R.rollno ∧ R.courseno=107 ∧ R.percent>90 ∧ T.sname=S.sname)} (IV) { | ∃S_R ∃S_N ( ∈ Students ∧ ∈ Registration ∧ R_P>90)}
Open complete paper
4
2013 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2013 [Session 4]
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% in the course numbered 107”
(I) SELECT DISTINCT S.sname
FROM Students as S, Registration as R
WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent>90
(II) \(\Pi_{sname}(\sigma_{courseno=107 \wedge percent>90}(Registration \bowtie Students))\)
(III) \(\{T \mid \exists S \in Students, \exists R \in Registration (S.rollno=R.rollno \wedge R.courseno=107 \wedge R.percent>90 \wedge T.sname=S.sname)\}\)
(IV) \(\{ \mid \exists S_N \in Students \wedge \exists R_N, R_P (R_N=S_N \wedge R_P=107 \wedge R_P>90 \wedge S_N=S.sname)\}\)
Open complete paper
5
2013 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2013 [Session 4]
How many candidate keys does the relation R have?
Open complete paper
6
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 1]
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 last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:

SQL>SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id);

What is the outcome?
Open complete paper
7
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 2]
Given an instance of the STUDENTS relation as shown below:
StudentIDStudentNameStudentEmailStudentAgeCPI
2345Shankarshankar@mathX9.4
1287Swatiswati@ee199.5
7853Shankarshankar@cse199.4
9876Swatiswati@mech189.3
8765Ganeshganesh@civil198.7

For \((StudentName, StudentAge)\) to be a key for this instance, the value X should NOT be equal to ____________.

Question diagram

Open complete paper
8
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 2]
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)
Open complete paper
9
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 3]
What is the optimized version of the relation algebra expression π_{A1}(π_{A2}(σ_{F1}(σ_{F2}(r)))), where A1, A2 are sets of attributes in r with A1 ⊂ A2 and F1, F2 are Boolean expressions based on the attributes in r?
Open complete paper
10
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 3]
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:

ΠempId(employee) - ΠempId (employee⋈ (empAge ≤ depAge ∧ empId = eId) dependent)

The above query evaluates to the set of empIds of employees whose age is greater than that of
Open complete paper
11
2014 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2014 [Session 3]
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
FROM customer C
WHERE C.salesRepId = E.empId
AND C.rating <> 'GOOD');
Open complete paper
12
2016 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2016 [Session 1]
Which of the following is NOT a superkey in a relational schema with attributes \(V, W, X, Y, Z\) and primary key \(V Y\)?
Open complete paper
13
2017 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2017 [Session 2]

An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?

Open complete paper
14
2017 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2017 [Session 2]
Consider the following database table named top_scorer.

top_scorer
playercountrygoals
KloseGermany16
RonaldoBrazil15
G MüllerGermany14
FontaineFrance13
PeléBrazil12
KlinsmannGermany11
KocsisHungary11
BatistutaArgentina10
CubillasPeru10
LatoPoland10
LinekerEngland10
T MüllerGermany10
RahnGermany10


Consider the following SQL query:

SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
    FROM top_scorer AS tb
    WHERE tb.country = 'Spain')
AND ta.goals >ANY (SELECT tc.goals
    FROM top_scorer AS tc
    WHERE tc.country = 'Germany')

The number of tuples returned by the above SQL query is __________.
Open complete paper
15
2018 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2018 [Session 2]
In an Entity-Relationship (ER) model, suppose \(R\) is a many-to-one relationship from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in \(R\) and that the cardinality of E1 is greater than the cardinality of E2.
Which one of the following is true about \(R\)?
Open complete paper
16
2018 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2018 [Session 2]
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 = S.isbn;
Query 2:SELECT B.isbn, S.copies
FROM Book B LEFT OUTER JOIN Stock S
ON B.isbn = S.isbn;
Query 3:SELECT B.isbn, S.copies
FROM Book B RIGHT OUTER JOIN Stock S
ON B.isbn = S.isbn;
Query 4:SELECT B.isbn, S.copies
FROM Book B FULL OUTER JOIN Stock S
ON B.isbn = S.isbn;
Which one of the queries above is certain to have an output that is a superset of the outputs of the other three queries?
Open complete paper
17
2018 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2018 [Session 2]
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 \bowtie (\sigma_{B<5}(s)) \) Let \( LOJ \) denote the natural left outer-join operation. Assume that \( r \) and \( s \) contain no null values. Which one of the following queries is NOT equivalent to \( Q \)?
Open complete paper
18
2019 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2019 [Session 2]
A relational database contains two tables Student and Performance as shown below:
Student
Roll no.Student_name
1Amit
2Priya
3Vinit
4Rohan
5Smita

Performance
Roll no.Subject_codeMarks
1A86
1B95
1C90
2A89
2C92
3C80

The primary key of the Student table is Roll no. For the Performance table, the columns Roll no. and Subject_code together form the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks) FROM Student S, Performance P WHERE P.Marks > 84 GROUP BY S.Student_name;
The number of rows returned by the above SQL query is ______.
Open complete paper
19
2019 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2019 [Session 2]
Consider the following relations P(X,Y,Z), Q(X,Y,T) and R(Y,V):
P
XYZ
X1Y1Z1
X1Y1Z2
X2Y2Z2
X2Y4Z4

Q
XYT
X2Y12
X1Y25
X1Y16
X3Y31

R
YV
Y1V1
Y3V2
Y2V3
Y2V2

How many tuples will be returned by the following relational algebra query?
\[ \prod_X (\sigma_{(P.Y=R.Y \wedge R.Y=V2)}(P \times R)) - \prod_X (\sigma_{(Q.Y=R.Y \wedge Q.T>2)}(Q \times R)) \]
Answer: ______.
Open complete paper
20
2020 · Computer Science & Information Technology · Databases · Relational Models, Algebra and SQL
Computer Science & Information Technology (CS) 2020 [Session 2]
Consider a relational database containing the following schemas.
Catalogue
snopnocost
S1P1150
S1P250
S1P3100
S2P4200
S2P5250
S3P1250
S3P2150
S3P3300
S3P4250

Suppliers
snosnamelocation
S1M/s Royal furnitureDelhi
S2M/s Balaji furnitureBangalore
S3M/s Premium furnitureChennai

Parts
pnopnamepart_spec
P1TableWood
P2ChairWood
P3TableSteel
P4AlmirahSteel
P5AlmirahWood

The primary key of each table is indicated by underlining the constituent fields.
SELECT s.sno, s.sname
FROM Suppliers s, Catalogue c
WHERE s.sno = c.sno AND
cost > (SELECT AVG (cost)
FROM Catalogue
WHERE pno = 'P4'
GROUP BY pno);
The number of rows returned by the above SQL query is

Question diagram

Open complete paper

Showing 20 of 36 questions