My Cart
Your Cart 0

    Your cart is empty.

  • Total (Amount) ₹0.00
Previous year question hub

Relational Databases and SQL - Database Management and Warehousing - Data Science & Artificial Intelligence Previous Year Questions

Practice Relational Databases and SQL - Database Management and Warehousing - Data Science & Artificial Intelligence previous year questions organised from real papers, with year-wise coverage and clear topic navigation.

3Papers
3Years
11Questions
1Topics

Relational Databases and SQL question pattern

Every graph below is calculated only from this selection.

Questions by year

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

Difficulty distribution

How the classified questions are distributed by difficulty.

Easy 6 54.5%
Medium 5 45.5%

Question type distribution

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

Numerical Answer Type (NAT) 5 45.5%
MCQ 4 36.4%
MSQ 2 18.2%

Subject weightage

Top subjects by unique question coverage.

Data Science & Artificial Intelligence
11 Qs

Most asked topics

Top topics across the included previous year papers.

Database Management and Warehousing
11 Qs

Subtopic coverage

Top subtopics inside this exact selection.

Relational Databases and SQL
11 Qs

Paper coverage

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

Data Science and Artificial Intelligence (DA) 2026
5 Qs
Data Science & Artificial Intelligence (DA) 2025
4 Qs
Data Science & Artificial Intelligence (DA) 2024
2 Qs

Included previous year papers

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

PaperYear / sessionQuestions in this viewOpen
Data Science and Artificial Intelligence (DA) 202620265View paper
Data Science & Artificial Intelligence (DA) 202520254View paper
Data Science & Artificial Intelligence (DA) 202420242View paper

All Relational Databases and SQL previous year questions

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

1
2024 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2024
Consider a database that includes the following relations:
Defender(name, rating, side, goals)
Forward(name, rating, assists, goals)
Team(name, club, price)
Which ONE of the following relational algebra expressions checks that every name occurring in Team appears in either Defender or Forward, where \(\phi\) denotes the empty set?
Open complete paper
2
2024 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2024
Consider the following two tables named Raider and Team in a relational database maintained by a Kabaddi league. The attribute ID in table Team references the primary key of the Raider table, ID.
Raider
IDNameRaidsRaidPoints
1Arjun200250
2Ankush190219
3Sunil150200
4Reza150190
5Prathem175220
6Gopal193215

Team
CityIDBidPoints
Jaipur2200
Patna3195
Hyderabad5175
Jaipur1250
Patna4200
Jaipur6200

The SQL query described below is executed on this database:
SELECT *
FROM Raider, Team
WHERE Raider.ID=Team.ID AND City=”Jaipur” AND RaidPoints > 200;
The number of rows returned by this query is ______.

Question diagram

Open complete paper
3
2025 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2025
Consider the following three relations:
Car (model, year, serial, color)
Make (maker, model)
Own (owner, serial)
A tuple in Car represents a specific car of a given model, made in a given year, with a serial number and a color. A tuple in Make specifies that a maker company makes cars of a certain model. A tuple in Own specifies that an owner owns the car with a given serial number. Keys are underlined; (owner, serial) together form key for Own. (⋈ denotes natural join)
\(\pi_{owner}(\text{Own} \bowtie (\sigma_{color='red'}(\text{Car}) \bowtie (\sigma_{maker='ABC'}(\text{Make}))))\)
Which one of the following options describes what the above expression computes?
Open complete paper
4
2025 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2025
On a relation named Loan of a bank:
Loan
loan_numberbranch_nameamount
L11Banjara Hills90000
L14Kondapur50000
L15SR Nagar40000
L22SR Nagar25000
L23Balanagar80000
L25Kondapur70000
L19SR Nagar65000

the following SQL query is executed.
SELECT L1.loan_number
FROM Loan L1
WHERE L1.amount > (SELECT MAX (L2.amount)
FROM Loan L2
WHERE L2.branch_name = 'SR Nagar');
The number of rows returned by the query is ______________ (Answer in integer)

Question diagram

Open complete paper
5
2025 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2025
Consider the following two relations, named Customer and Person, in a database:
Person (
aadhaar CHAR(12) PRIMARY KEY,
name VARCHAR(32) );

Customer (
name VARCHAR(32),
email VARCHAR(32) PRIMARY KEY,
phone CHAR(10),
aadhaar CHAR(12),
FOREIGN KEY (aadhaar) REFERENCES Person(aadhaar) );Which of the following statements is/are correct?
Open complete paper
6
2025 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science & Artificial Intelligence (DA) 2025
Consider the following tables, Loan and Borrower, of a bank.
Loan
loan_numbranch_nameamount
L11Banjara Hills90000
L14Kondapur50000
L15SR Nagar40000
L22SR Nagar25000
L23Balanagar80000
L25Kondapur70000
L19SR Nagar65000

Borrower
customer_nameloan_num
AnandL11
KarteekL11
KarteekL14
AnkitaL15
GopalL19
KarteekL22
KarteekL23
SunilL23
SunilL25

Query: \(\pi_{\text{branch\_name, customer\_name}} (\text{Loan} \bowtie \text{Borrower}) \div \pi_{\text{branch\_name}} (\text{Loan})\) where \(\bowtie\) denotes natural join. The number of tuples returned by the above relational algebra query is __________ (Answer in integer)

Question diagram

Question diagram

Open complete paper
7
2026 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science and Artificial Intelligence (DA) 2026
Consider two relations r and s defined on the relational schemas R(A, B) and S(E, C), respectively. A is the primary key of R and E is a foreign key of S referencing A in R.
Which of the following operations will NEVER violate the foreign key constraint?
Open complete paper
8
2026 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science and Artificial Intelligence (DA) 2026
Consider the given relations \(X\), \(Y\) and \(Z\). The relation \(X\) has three columns \(P\), \(Q\) and \(R\). The relation \(Y\) has three columns \(P\), \(Q\) and \(S\). The relation \(Z\) has two columns \(P\) and \(T\).
X
PQR
P1Q1R1
P2Q2R2
P3Q3R2

Y
PQS
P1Q12
P1Q25
P2Q16
P3Q31

Z
PT
P1T1
P3T2
P4T3
P4NULL

Consider the relational algebra expression
\[\Pi_{PRS}\left[\left(\sigma_{Q = Q3 \vee R = R2}[X] \bowtie Y\right) \bowtie \left(\sigma_{(S > 1)}[Y \bowtie Z]\right)\right]\]
where \(\bowtie\) denotes natural join operation.
Which of the following options is the correct output for the given expression?

Question diagram

Open complete paper
9
2026 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science and Artificial Intelligence (DA) 2026
Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column.
We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
Which of the following is/are correct?

Question diagram

Open complete paper
10
2026 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science and Artificial Intelligence (DA) 2026
Let there be two relations X and Y as shown. X has three columns P, Q and R. Y has two columns P and S.

XY
PQRPS
P1Q1R1P110
P2Q2R2P115
P3Q3R2P220
P31


Consider that the following tuple relational calculus expression is evaluated.

\[ \{t \mid t \in X \land \exists z \in X (t[P] = z[P]) \land \exists m \in Y (m[P] = t[P] \land m[S] > 1)\} \]

The number of tuples that will be returned is __________ . (Answer in integer)
Open complete paper
11
2026 · Data Science & Artificial Intelligence · Database Management and Warehousing · Relational Databases and SQL
Data Science and Artificial Intelligence (DA) 2026
Let Account be a relation as shown.

AccNoBalance
A15000
A25000
A310000
A415000
A518000


Consider the given SQL query.

SELECT AccNo FROM Account AS A
WHERE (SELECT COUNT(*) FROM Account AS B
WHERE A.Balance < B.Balance) >= (SELECT COUNT(*) FROM Account AS C WHERE A.Balance > C.Balance)

The number of rows returned by the SQL query is __________ . (Answer in integer)
Open complete paper