Topics in Relational Query Languages

Filter by year

Relational Query Languages questions

Q42

GATE DA 2026 DARelational Query LanguagesMCQ2 marks−2/3 if wrong

Report a problem with Q42

What is wrong?
Consider the given relations XX, YY and ZZ. The relation XX has three columns PP, QQ and RR. The relation YY has three columns PP, QQ and SS. The relation ZZ has two columns PP and TT.

XX
PPQQRR
P1Q1R1
P2Q2R2
P3Q3R2
YY
PPQQSS
P1Q12
P1Q25
P2Q16
P3Q31
ZZ
PPTT
P1T1
P3T2
P4T3
P4NULL
Consider the relational algebra expression
ΠPRS[(σ(Q=Q3∨R=R2)[X⋈Y])⋈(σ(S>1)[Y⋈Z])]\Pi_{PRS}[(\sigma_{(Q = Q3 \lor R = R2)}[X \bowtie Y]) \bowtie (\sigma_{(S > 1)}[Y \bowtie Z])]
where ⋈\bowtie denotes natural join operation.
Which of the following options is the correct output for the given expression?
Show answer without attempting

Loading the answer…

Q51

GATE DA 2026 DARelational Query LanguagesMSQ2 marks

Report a problem with Q51

What is wrong?
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?

Employee
EmpIDTeamID
18
28
38
47
57
69
Output
EmpIDTeamSize
13
23
33
42
52
61
More than one option can be correct.
Show answer without attempting

Loading the answer…

Q59

GATE DA 2026 DARelational Query LanguagesNAT2 marks

Report a problem with Q59

What is wrong?
Let there be two relations XX and YY as shown. XX has three columns PP, QQ and RR. YY has two columns PP and SS.

XX
PPQQRR
P1Q1R1
P2Q2R2
P3Q3R2
YY
PPSS
P110
P115
P220
P31
Consider that the following tuple relational calculus expression is evaluated.
{t∣t∈X⋀∃z∈X(t[P]=z[P])⋀∃m∈Y(m[P]=t[P]⋀m[S]>1)}\{t \mid t \in X \bigwedge \exists z \in X(t[P] = z[P]) \bigwedge \exists m \in Y (m[P] = t[P] \bigwedge m[S] > 1)\}
The number of tuples that will be returned is __________ . (Answer in integer)
Show answer without attempting

Loading the answer…

Q60

GATE DA 2026 DARelational Query LanguagesNAT2 marks

Report a problem with Q60

What is wrong?
Let Account be a relation as shown.

Account
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)
Show answer without attempting

Loading the answer…

0/40 correct0 marks

Related topics in Database Management and Warehousing